class_docstr: A CIFAR-10 data provider.
docstr: Returns a partition of the CIFAR-10 `Dataset`.
docstr_tok: ["Returns","a","partition","of","the","CIFAR-10","`","Dataset","`","."]
code: def _cifar10_dataset(self, partition):
      """Returns a partition of the CIFAR-10 `Dataset`."""
      cifar10_data = None
      try:
          cifar10_data = cifar10.load_data()
          tf.logging.info("Loaded cifar10.")
      except:  # pylint: disable=bare-except
          tf.logging.info(
              "Can not load cifar10 from internet. Creating dummy data for "
              "testing."
          )
          data = np.zeros((3, 32, 32, 3))
          labels = np.array([[5], [3], [9]])
          data[:, 0, 0] = [148, 141, 174]
          data[:, -1, 0, 0] = 128
          cifar10_data = ((data, labels), (data, labels))
      (x_train, y_train), (x_test, y_test) = cifar10_data
      x = None
      y = None
      if partition == "train":
          x, y = x_train, y_train
      else:
          x, y = x_test, y_test
  
      dataset = tf.data.Dataset.from_tensor_slices(
          (x, y.astype(np.int32))
      )
      return dataset.cache()
  
file_path: adanet/research/improve_nas/trainer/cifar10.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import tensorflow.compat.v1
  from tensorflow.keras.datasets import cifar10
label_desc: Use image node_id 3 for calling the Provider obj's underlying member method code with example usage: obj._cifar10_dataset(partition) and returns: dataset