class_docstr: IODataset
docstr: Creates an `IODataset` from a Numpy file.
  
  The `from_numpy_file` allows user to create a Dataset from
  a numpy file (npy or npz). The `Dataset` created through
  `from_numpy_file` has the same dtypes as the elements in numpy
  file. The shapes of the Dataset is similar to the elements of
  numpy file, except the first dimensions of the shapes are set
  to None. The reason is that first dimensions of the iterated
  output which may not be dividable to the total number of elements.
  In case numpy file consists of unnamed elements, a tuple of numpy
  arrays are returned, otherwise a dict is returned for named
  elements.
  
  Args:
    filename: filename of numpy file (npy or npz).
    spec: A tuple of tf.TensorSpec or dtype, or a dict of
      `name:tf.TensorSpec` or `name:dtype` pairs to specify the dtypes
      in each element of the numpy file. In eager mode spec is automatically
      probed. In graph spec must be provided. If a tuple is provided for
      spec then it is assumed that numpy file consists of `arr_0`, `arr_2`...
      If a dict is provided then numpy file should consists of named
      elements.
    name: A name prefix for the IOTensor (optional).
  
  Returns:
    A `IODataset` with the same dtypes as of the array_like in numpy
      file (npy or npz).
docstr_tok: ["Creates","an","`","IODataset","`","from","a","Numpy","file",".","The","`","from_numpy_file","`","allows","user","to","create","a","Dataset","from","a","numpy","file","(","npy","or","npz",")",".","The","`","Dataset","`","created","through","`","from_numpy_file","`","has","the","same","dtypes","as","the","elements","in","numpy","file",".","The","shapes","of","the","Dataset","is","similar","to","the","elements","of","numpy","file",",","except","the","first","dimensions","of","the","shapes","are","set","to","None",".","The","reason","is","that","first","dimensions","of","the","iterated","output","which","may","not","be","dividable","to","the","total","number","of","elements",".","In","case","numpy","file","consists","of","unnamed","elements",",","a","tuple","of","numpy","arrays","are","returned",",","otherwise","a","dict","is","returned","for","named","elements",".","Args",":","filename",":","filename","of","numpy","file","(","npy","or","npz",")",".","spec",":","A","tuple","of","tf.TensorSpec","or","dtype",",","or","a","dict","of","`","name",":","tf.TensorSpec","`","or","`","name",":","dtype","`","pairs","to","specify","the","dtypes","in","each","element","of","the","numpy","file",".","In","eager","mode","spec","is","automatically","probed",".","In","graph","spec","must","be","provided",".","If","a","tuple","is","provided","for","spec","then","it","is","assumed","that","numpy","file","consists","of","`","arr_0","`",",","`","arr_2","`","...","If","a","dict","is","provided","then","numpy","file","should","consists","of","named","elements",".","name",":","A","name","prefix","for","the","IOTensor","(","optional",")",".","Returns",":","A","`","IODataset","`","with","the","same","dtypes","as","of","the","array_like","in","numpy","file","(","npy","or","npz",")","."]
code: def from_numpy_file(cls, filename, spec=None, **kwargs):
      """Creates an `IODataset` from a Numpy file.
  
      The `from_numpy_file` allows user to create a Dataset from
      a numpy file (npy or npz). The `Dataset` created through
      `from_numpy_file` has the same dtypes as the elements in numpy
      file. The shapes of the Dataset is similar to the elements of
      numpy file, except the first dimensions of the shapes are set
      to None. The reason is that first dimensions of the iterated
      output which may not be dividable to the total number of elements.
      In case numpy file consists of unnamed elements, a tuple of numpy
      arrays are returned, otherwise a dict is returned for named
      elements.
  
      Args:
        filename: filename of numpy file (npy or npz).
        spec: A tuple of tf.TensorSpec or dtype, or a dict of
          `name:tf.TensorSpec` or `name:dtype` pairs to specify the dtypes
          in each element of the numpy file. In eager mode spec is automatically
          probed. In graph spec must be provided. If a tuple is provided for
          spec then it is assumed that numpy file consists of `arr_0`, `arr_2`...
          If a dict is provided then numpy file should consists of named
          elements.
        name: A name prefix for the IOTensor (optional).
  
      Returns:
        A `IODataset` with the same dtypes as of the array_like in numpy
          file (npy or npz).
      """
      with tf.name_scope(kwargs.get("name", "IOFromNumpyFile")):
          return numpy_dataset_ops.NumpyFileIODataset(
              filename, spec=spec, internal=True
          )
  
imports: import tensorflow
  from tensorflow_io.python.ops import io_dataset
  from tensorflow_io.python.experimental import libsvm_dataset_ops
  from tensorflow_io.python.experimental import image_dataset_ops
  from tensorflow_io.python.experimental import kinesis_dataset_ops
  from tensorflow_io.python.experimental import pubsub_dataset_ops
  from tensorflow_io.python.experimental import grpc_dataset_ops
  from tensorflow_io.python.experimental import file_dataset_ops
  from tensorflow_io.python.experimental import numpy_dataset_ops
  from tensorflow_io.python.experimental import sql_dataset_ops
  from tensorflow_io.python.experimental import video_dataset_ops
label_desc: Use image node_id 6 for calling the IODataset obj's underlying member method code with example usage: obj.from_numpy_file(cls, filename, spec) and returns: numpy_dataset_ops