class_docstr: A SessionRunHook handles ops related to SyncReplicasOptimizer.
class_docstr_tok: ["A","SessionRunHook","handles","ops","related","to","SyncReplicasOptimizer","."]
docstr: Creates hook to handle SyncReplicasOptimizer initialization ops.
  
  Args:
    sync_optimizer: `SyncReplicasOptimizer` which this hook will initialize.
    is_chief: `Bool`, whether is this a chief replica or not.
    num_tokens: Number of tokens to add to the queue.
docstr_tok: ["Creates","hook","to","handle","SyncReplicasOptimizer","initialization","ops",".","Args",":","sync_optimizer",":","`","SyncReplicasOptimizer","`","which","this","hook","will","initialize",".","is_chief",":","`","Bool","`",",","whether","is","this","a","chief","replica","or","not",".","num_tokens",":","Number","of","tokens","to","add","to","the","queue","."]
code: def __init__(self, sync_optimizer, is_chief, num_tokens):
      """Creates hook to handle SyncReplicasOptimizer initialization ops.
  
      Args:
        sync_optimizer: `SyncReplicasOptimizer` which this hook will initialize.
        is_chief: `Bool`, whether is this a chief replica or not.
        num_tokens: Number of tokens to add to the queue.
      """
      self._sync_optimizer = sync_optimizer
      self._is_chief = is_chief
      self._num_tokens = num_tokens
  
imports: from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import data_flow_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import optimizer
  from tensorflow.python.training import queue_runner
  from tensorflow.python.training import session_manager
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 to create a new _SyncReplicasOptimizerHook object from inherited base classes: session_run_hook with example: obj = _SyncReplicasOptimizerHook(sync_optimizer, is_chief, num_tokens)