docstr: Args:
      index (int): index of this tower, only used in training.
      total (int): total number of towers to be built.
docstr_tok: ["Args",":","index","(","int",")",":","index","of","this","tower",",","only","used","in","training",".","total","(","int",")",":","total","number","of","towers","to","be","built","."]
code: def __init__(self, ns_name, vs_name="", index=0, total=1):
      """
      Args:
          index (int): index of this tower, only used in training.
          total (int): total number of towers to be built.
      """
      super(TrainTowerContext, self).__init__(ns_name, vs_name)
      self._is_training = True
  
      self.index = int(index)
      self.total = int(total)
      if self.index > 0:
          assert (
              self.total > self.index
          ), "(index, total) = ({}, {})".format(self.index, self.total)
  
      vs = tf.get_variable_scope()
      assert (
          vs.name == ""
      ), "Cannot nest TrainTowerContext with an existing variable scope!"
      if vs_name:
          assert (
              not vs.reuse
          ), "Cannot create tower {} with vs_name={} under reuse=True!".format(
              ns_name, vs_name
          )
      self._original_vs_reuse = vs.reuse
  
imports: from abc import ABCMeta, abstractmethod, abstractproperty
  import six
  from ..compat import tfv1
  from ..utils import logger
  from ..utils.argtools import call_only_once
  from ..utils.develop import HIDE_DOC
  from ..utils.naming import MOVING_SUMMARY_OPS_KEY
  from .collection import CollectionGuard
  from .common import get_op_or_tensor_by_name, get_op_tensor_name
label_desc: Use image node_id 1 to create a new TrainTowerContext object from inherited base classes: BaseTowerContext with example: obj = TrainTowerContext(ns_name, vs_name, index, total)