class_docstr: Wrapper class that acts as the input_fn to TPUEstimator.
class_docstr_tok: ["Wrapper","class","that","acts","as","the","input_fn","to","TPUEstimator","."]
docstr: Input function which provides a single batch for train or eval.
docstr_tok: ["Input","function","which","provides","a","single","batch","for","train","or","eval","."]
code: def __call__(self, params):
      """Input function which provides a single batch for train or eval."""
      # Retrieves the batch size for the current shard. The # of shards is
      # computed according to the input pipeline deployment. See
      # `tf.estimator.tpu.RunConfig` for details.
      batch_size = params["batch_size"]
      logging.info(
          "call ToyModelInput() with batch size {}".format(batch_size)
      )
  
      ds = Dataset.from_tensor_slices(
          (self._images, self._labels)
      ).repeat()
  
      dataset = ds.batch(batch_size, drop_remainder=True).prefetch(2)
  
      return dataset
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  import numpy
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.python.data.ops.dataset_ops import Dataset
  from tensorflow.python.platform import flags
  from tensorflow.python.platform import tf_logging
  from tensorflow_estimator.python.estimator import estimator
  from tensorflow_estimator.python.estimator.tpu import tpu_config
  from tensorflow_estimator.python.estimator.tpu import tpu_estimator
label_desc: Use image node_id 2 for calling the ToyModelInput obj's underlying member method code with example usage: obj.__call__(params) and returns: dataset