class_docstr: NumpyIODataset
class_docstr_tok: ["NumpyIODataset"]
docstr: NumpyIODataset.
docstr_tok: ["NumpyIODataset","."]
code: def __init__(self, a, internal=True):
      """NumpyIODataset."""
      with tf.name_scope("NumpyIODataset"):
          assert internal
  
          entries = a
  
          def p(entry):
              address, _ = entry.__array_interface__["data"]
              shape = entry.shape
              dtype = tf.as_dtype(entry.dtype)
              return address, "", "", shape, dtype
  
          flatten = tf.nest.flatten(entries)
          assert all(
              [
                  entry.shape[0] == flatten[0].shape[0]
                  for entry in flatten
              ]
          )
  
          params = [p(entry) for entry in flatten]
  
          def f(start, stop):
              return tf.nest.pack_sequence_as(
                  entries,
                  [
                      core_ops.io_numpy_read(
                          address=address,
                          filename=filename,
                          array=array,
                          shape=shape,
                          start=start,
                          stop=stop,
                          dtype=dtype,
                      )
                      for address, filename, array, shape, dtype in params
                  ],
              )
  
          step = 1024
          total = tf.constant(flatten[0].shape[0], tf.int64)
          indices_start = tf.data.Dataset.range(0, total, step)
          indices_stop = indices_start.skip(1).concatenate(
              tf.data.Dataset.from_tensor_slices([total])
          )
          dataset = tf.data.Dataset.zip((indices_start, indices_stop))
          dataset = dataset.map(f)
          dataset = dataset.unbatch()
  
          self._dataset = dataset
          self._holder = [
              np.array(entry, copy=False) for entry in flatten
          ]
          super().__init__(self._dataset._variant_tensor)
  
file_path: io/tensorflow_io/python/experimental/numpy_dataset_ops.py
imports: import numpy
  import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 1 to create a new NumpyIODataset object from inherited base classes: tf.data with example: obj = NumpyIODataset(a, internal)