class_docstr: Context manager to automatically add control dependencies.
  
  Code under this context manager will act as if a sensible set of control
  dependencies were present. More specifically:
    1. All stateful ops in the scope will execute (with the exception of ops in
       ASYNC_STATEFUL_OPS and LEGACY_RANDOM_OPS)
    2. Stateful ops which modify the same resource will execute in program order
  
  Note: creating variables in an automatic control dependencies context is not
  supported (the value of the variables will never change as they will keep
  getting reinitialized).
  
  NOT THREAD SAFE
class_docstr_tok: ["Context","manager","to","automatically","add","control","dependencies",".","Code","under","this","context","manager","will","act","as","if","a","sensible","set","of","control","dependencies","were","present",".","More","specifically",":","1",".","All","stateful","ops","in","the","scope","will","execute","(","with","the","exception","of","ops","in","ASYNC_STATEFUL_OPS","and","LEGACY_RANDOM_OPS",")","2",".","Stateful","ops","which","modify","the","same","resource","will","execute","in","program","order","Note",":","creating","variables","in","an","automatic","control","dependencies","context","is","not","supported","(","the","value","of","the","variables","will","never","change","as","they","will","keep","getting","reinitialized",")",".","NOT","THREAD","SAFE"]
code: def __enter__(self):
      if context.executing_eagerly():
          return self
      # This code assumes no other thread is adding ops to the graph while
      # we're adding ops to the graph.
      # TODO(apassos): Fix this by locking the graph or using a temporary
      # graph (but that would mess up devices and collections at least,
      # probably other things as well).
      g = ops.get_default_graph()
      self._graph = g
      g._add_control_dependencies = (
          True  # pylint: disable=protected-access
      )
      g.experimental_acd_manager = self
      self._n_operations = g.num_operations()
      return self
  
imports: import collections
  import enum
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import auto_control_deps_utils
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import registry
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.util import nest
  from tensorflow.python.util import object_identity
  from tensorflow.python.util import tf_decorator
label_desc: Use image node_id 4 for calling the AutomaticControlDependencies obj's underlying member method code with example usage: obj.__enter__() and returns: self, self