class_docstr: Launch collectives on one replica.
class_docstr_tok: ["Launch","collectives","on","one","replica","."]
code: def __init__(
      self,
      group_key: int,
      group_size: int,
      collective_keys: CollectiveKeys,
      device: str,
      options: collective_util.Options,
  ):
      self._group_key = group_key
      self._group_size = group_size
      self._collective_keys = collective_keys
      self._device = device
      self._options = options
      if self._use_ordering_token():
          with ops.init_scope(), ops.device(device):
              self._ordering_token = (
                  resource_variable_ops.ResourceVariable(0.0)
              )
      else:
          self._ordering_token = None
  
imports: import copy
  import threading
  from typing import Callable, List, Optional, Union
  from tensorflow.python.distribute import collective_util
  from tensorflow.python.distribute import values
  from tensorflow.python.eager import backprop_util
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import collective_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nccl_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.types import core
label_desc: Use image node_id 1 to create a new CollectiveReplicaLauncher object from inherited base classes: object with example: obj = CollectiveReplicaLauncher(group_key, group_size, collective_keys, device, options)