class_docstr: A dataset for MNIST.
class_docstr_tok: ["A","dataset","for","MNIST","."]
docstr: Construct a DataSet.
  
  one_hot arg is used only if fake_data is true.  `dtype` can be either
  `uint8` to leave the input as `[0, 255]`, or `float32` to rescale into
  `[0, 1]`.  Seed arg provides for convenient deterministic testing.
docstr_tok: ["Construct","a","DataSet",".","one_hot","arg","is","used","only","if","fake_data","is","true",".","`","dtype","`","can","be","either","`","uint8","`","to","leave","the","input","as","`","[","0",",","255","]","`",",","or","`","float32","`","to","rescale","into","`","[","0",",","1","]","`",".","Seed","arg","provides","for","convenient","deterministic","testing","."]
code: def __init__(
      self,
      images,
      labels,
      fake_data=False,  # pylint:disable=unused-argument
      one_hot=False,  # pylint:disable=unused-argument
      dtype=np.float32,
      reshape=True,
      seed=None,  # pylint:disable=unused-argument
  ):  # pylint:disable=g-doc-args
      """Construct a DataSet.
  
      one_hot arg is used only if fake_data is true.  `dtype` can be either
      `uint8` to leave the input as `[0, 255]`, or `float32` to rescale into
      `[0, 1]`.  Seed arg provides for convenient deterministic testing.
      """
      # If op level seed is not set, use whatever graph level seed is
      # returned.
      np.random.seed()
      assert (
          images.shape[0] == labels.shape[0]
      ), "images.shape: %s labels.shape: %s" % (
          images.shape,
          labels.shape,
      )
      self._num_examples = images.shape[0]
  
      # Convert shape from [num examples, rows, columns, depth]
      # to [num examples, rows*columns] (assuming depth == 1)
      if reshape:
          assert images.shape[3] == 1
          images = images.reshape(
              images.shape[0], images.shape[1] * images.shape[2]
          )
      if dtype == np.float32:  # Convert from [0, 255] -> [0.0, 1.0].
          images = images.astype(np.float32)
          images = np.multiply(images, 1.0 / 255.0)
      self._images = images
      self._labels = labels
      self._epochs_completed = 0
      self._index_in_epoch = 0
  
file_path: magenta/magenta/models/latent_transfer/local_mnist.py
imports: import gzip
  import os
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 to create a new DataSet object from inherited base classes: object with example: obj = DataSet(images, labels, fake_data, one_hot, dtype, reshape, seed)