class_docstr: Phoenix: A smart search AutoML algorithm.
class_docstr_tok: ["Phoenix",":","A","smart","search","AutoML","algorithm","."]
docstr: Increments the global step based on the tower size.
  
  N.B. if the tower size does not divide evenly into the train_steps, it will
  train for longer than required.
  
  Args:
    train_op: The train_op to execute before incrementing the global_step.
    train_steps: The total number of steps to train for.
    tower_name: The name of the tower which is currently training.
  
  Returns:
    An tf.Op which increments the global step by the required amount.
docstr_tok: ["Increments","the","global","step","based","on","the","tower","size",".","N.B",".","if","the","tower","size","does","not","divide","evenly","into","the","train_steps",",","it","will","train","for","longer","than","required",".","Args",":","train_op",":","The","train_op","to","execute","before","incrementing","the","global_step",".","train_steps",":","The","total","number","of","steps","to","train","for",".","tower_name",":","The","name","of","the","tower","which","is","currently","training",".","Returns",":","An","tf.Op","which","increments","the","global","step","by","the","required","amount","."]
code: def _increment_global_step(self, train_op, train_steps, tower_name):
      """Increments the global step based on the tower size.
  
      N.B. if the tower size does not divide evenly into the train_steps, it will
      train for longer than required.
  
      Args:
        train_op: The train_op to execute before incrementing the global_step.
        train_steps: The total number of steps to train for.
        tower_name: The name of the tower which is currently training.
  
      Returns:
        An tf.Op which increments the global step by the required amount.
      """
      if self._phoenix_spec.use_synchronous_optimizer:
          return train_op
  
      increment_amount = 1
      tower_size = architecture_utils.get_architecture_size(tower_name)
      if (
          self._phoenix_spec.use_parameter_scaled_training
          and tower_size
      ):
          train_step_per_block = max(
              int(train_steps // self._phoenix_spec.maximum_depth), 1
          )
          tower_train_steps = tower_size * train_step_per_block
          increment_amount = max(
              int(train_steps // tower_train_steps), 1
          )
  
      with tf.control_dependencies([train_op]):
          global_step = tf.compat.v1.train.get_or_create_global_step()
          return tf.compat.v1.assign_add(global_step, increment_amount)
  
imports: import functools
  import inspect
  from absl import logging
  import keras_tuner
  from model_search import controller
  from model_search import hparam
  from model_search import loss_fns
  from model_search import metric_fns
  from model_search import task_manager
  from model_search.architecture import architecture_utils
  from model_search.generators import base_tower_generator
  from model_search.generators import trial_utils
  from model_search.meta import transfer_learning
  from model_search.metadata import ml_metadata_db
  from model_search.proto import phoenix_spec_pb2
  from model_search.proto import transfer_learning_spec_pb2
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 6 for calling the Phoenix obj's underlying member method code with example usage: obj._increment_global_step(train_op, train_steps, tower_name) and returns: train_op, tf