code: def is_variable_initialized(ref, name=None):
      """Checks whether a tensor has been initialized.
  
      Outputs boolean scalar indicating whether the tensor has been initialized.
  
      Args:
        ref: A mutable `Tensor`.
          Should be from a `Variable` node. May be uninitialized.
        name: A name for the operation (optional).
  
      Returns:
        A `Tensor` of type `bool`.
      """
      if ref.dtype._is_ref_dtype:
          return gen_state_ops.is_variable_initialized(
              ref=ref, name=name
          )
      # Handle resource variables.
      return ref.is_initialized(name=name)
  
imports: from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import gen_resource_variable_ops
  from tensorflow.python.ops import gen_state_ops
  from tensorflow.python.ops import state_grad
  from tensorflow.python.ops.gen_state_ops import *
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.deprecation import deprecated
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling a global function with example usage: is_variable_initialized(ref, name) and returns: ref, gen_state_ops