class_docstr: A context where the current model is built in.
  You need to use :func:`TowerContext` to create a :class:`BaseTowerContext`.
class_docstr_tok: ["A","context","where","the","current","model","is","built","in",".","You","need","to","use",":","func",":","`","TowerContext","`","to","create","a",":","class",":","`","BaseTowerContext","`","."]
code: def __enter__(self):
      global _CurrentTowerContext
      assert _CurrentTowerContext is None, "Cannot nest TowerContext!"
      _CurrentTowerContext = self
  
      self._collection_guard = CollectionGuard(
          self._name,
          check_diff=not self.is_main_training_tower,
          freeze_keys=self._keys_to_freeze(),
      )
  
      self._ctxs = self._get_scopes()
      self._ctxs.append(self._collection_guard)
      for c in self._ctxs:
          c.__enter__()
  
      # check that ns_name is always the same as _name
      ns = tf.get_default_graph().get_name_scope()
      assert ns == self._name, (
          "Name conflict: name_scope inside tower '{}' becomes '{}'!".format(
              self._name, ns
          )
          + " You may need a different name for the tower!"
      )
      return self
  
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 10 for calling the BaseTowerContext obj's underlying member method code with example usage: obj.__enter__() and returns: self