(
      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
  )
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.
Construct a DataSet.
Construct a DataSet .
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
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 # 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