class_docstr: A checkpointable object whose NumPy array attributes are saved/restored.
  
  Example usage:
  
  ```python
  arrays = numpy_storage.NumpyState()
  checkpoint = tf.train.Checkpoint(numpy_arrays=arrays)
  arrays.x = np.ones([3, 4])
  directory = self.get_temp_dir()
  prefix = os.path.join(directory, 'ckpt')
  save_path = checkpoint.save(prefix)
  arrays.x[:] = 0.
  assert (arrays.x == np.zeros([3, 4])).all()
  checkpoint.restore(save_path)
  assert (arrays.x == np.ones([3, 4])).all()
  
  second_checkpoint = tf.train.Checkpoint(
      numpy_arrays=numpy_storage.NumpyState())
  # Attributes of NumpyState objects are created automatically by restore()
  second_checkpoint.restore(save_path)
  assert (second_checkpoint.numpy_arrays.x == np.ones([3, 4])).all()
  ```
  
  Note that `NumpyState` objects re-create the attributes of the previously
  saved object on `restore()`. This is in contrast to TensorFlow variables, for
  which a `Variable` object must be created and assigned to an attribute.
  
  This snippet works both when graph building and when executing eagerly. On
  save, the NumPy array(s) are fed as strings to be saved in the checkpoint (via
  a placeholder when graph building, or as a string constant when executing
  eagerly). When restoring they skip the TensorFlow graph entirely, and so no
  restore ops need be run. This means that restoration always happens eagerly,
  rather than waiting for `checkpoint.restore(...).run_restore_ops()` like
  TensorFlow variables when graph building.
docstr: Create placeholder NumPy arrays for to-be-restored attributes.
  
  Typically `_lookup_dependency` is used to check by name whether a dependency
  exists. We cheat slightly by creating a checkpointable object for `name` if
  we don't already have one, giving us attribute re-creation behavior when
  loading a checkpoint.
  
  Args:
    name: The name of the dependency being checked.
    cached_dependencies: Optional dictionary of dependencies.
  
  Returns:
    An existing dependency if one exists, or a new `_NumpyWrapper` placeholder
    dependency (which will generally be restored immediately).
docstr_tok: ["Create","placeholder","NumPy","arrays","for","to-be-restored","attributes",".","Typically","`","_lookup_dependency","`","is","used","to","check","by","name","whether","a","dependency","exists",".","We","cheat","slightly","by","creating","a","checkpointable","object","for","`","name","`","if","we","do","n't","already","have","one",",","giving","us","attribute","re-creation","behavior","when","loading","a","checkpoint",".","Args",":","name",":","The","name","of","the","dependency","being","checked",".","cached_dependencies",":","Optional","dictionary","of","dependencies",".","Returns",":","An","existing","dependency","if","one","exists",",","or","a","new","`","_NumpyWrapper","`","placeholder","dependency","(","which","will","generally","be","restored","immediately",")","."]
code: def _lookup_dependency(self, name, cached_dependencies=None):
      """Create placeholder NumPy arrays for to-be-restored attributes.
  
      Typically `_lookup_dependency` is used to check by name whether a dependency
      exists. We cheat slightly by creating a checkpointable object for `name` if
      we don't already have one, giving us attribute re-creation behavior when
      loading a checkpoint.
  
      Args:
        name: The name of the dependency being checked.
        cached_dependencies: Optional dictionary of dependencies.
  
      Returns:
        An existing dependency if one exists, or a new `_NumpyWrapper` placeholder
        dependency (which will generally be restored immediately).
      """
      if cached_dependencies is not None:
          value = cached_dependencies.get(name)
      else:
          value = super(NumpyState, self)._lookup_dependency(name)
      if value is None:
          value = _NumpyWrapper(np.array([]))
          new_reference = base.TrackableReference(name=name, ref=value)
          self._unconditional_checkpoint_dependencies.append(
              new_reference
          )
          self._unconditional_dependency_names[name] = value
          super(NumpyState, self).__setattr__(name, value)
          if cached_dependencies:
              cached_dependencies[name] = value
      return value
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import io
  import numpy
  import tensorflow
  from tf_agents.specs import array_spec
  from tensorflow.python.trackable import base
  from tensorflow.python.trackable import data_structures
label_desc: Use image node_id 1 for calling the NumpyState obj's underlying member method code with example usage: obj._lookup_dependency(name, cached_dependencies) and returns: value