class_docstr: Class to track uninitialized lazy variables.
class_docstr_tok: ["Class","to","track","uninitialized","lazy","variables","."]
docstr: Initialize all uninitialized lazy variables stored in scope.
docstr_tok: ["Initialize","all","uninitialized","lazy","variables","stored","in","scope","."]
code: def initialize_all(self):
      """Initialize all uninitialized lazy variables stored in scope."""
  
      def assign_function(uninitialized_var_list):
          for var in uninitialized_var_list:
              val = (
                  var._initial_value
              )  # pylint: disable=protected-access
              packed_var = getattr(var, "_packed_var", None)
              handle = getattr(packed_var, "packed_handle", var.handle)
  
              with ops.device(handle.device):
                  resource_variable_ops.AssignVariableOp(
                      resource=handle, value=val
                  )
          return constant_op.constant([])
  
      assign_tf_function = def_function.function(
          assign_function,
          autograph=False,
          jit_compile=False,
      )
  
      with ops.init_scope():
          if len(self._uninitialized_var_list) > 1:
              assign_tf_function(self._uninitialized_var_list)
          else:
              assign_function(self._uninitialized_var_list)
  
      self._uninitialized_var_list = []
  
imports: import contextlib
  from tensorflow.python.distribute import packed_distributed_variable
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.tpu import tpu_replication
label_desc: Use image node_id 2 for calling the LazyVariableTracker obj's underlying member method code with example usage: obj.initialize_all() and returns: constant_op