(self, params=None, split=None)
return ds.prefetch(tf.contrib.data.AUTOTUNE)
Input function for reading data.

    Args:
      params: Python dictionary with parameters. Must contain the key
        "batch_size". TPUEstimator will set this for you!
      split: Name of the split to use. If None will use the default eval split
        of the dataset.

    Returns:
      `tf.data.Dataset` with preprocessed and batched examples.
Input function for reading data.
Input function for reading data .
def eval_input_fn(self, params=None, split=None):
    """Input function for reading data.

    Args:
      params: Python dictionary with parameters. Must contain the key
        "batch_size". TPUEstimator will set this for you!
      split: Name of the split to use. If None will use the default eval split
        of the dataset.

    Returns:
      `tf.data.Dataset` with preprocessed and batched examples.
    """
    if params is None:
      params = {}
    if split is None:
      split = self._eval_split
    seed = self._get_per_host_random_seed(params.get("context", None))
    logging.info("eval_input_fn(): params=%s seed=%s", params, seed)

    ds = self._load_dataset(split=split)
    # No filter, no rpeat.
    ds = ds.map(functools.partial(self._eval_transform_fn, seed=seed))
    # No shuffle.
    if "batch_size" in params:
      ds = ds.batch(params["batch_size"], drop_remainder=True)
    return ds.prefetch(tf.contrib.data.AUTOTUNE)
def eval_input_fn ( self , params = None , split = None ) : if params is None : params = { } if split is None : split = self . _eval_split seed = self . _get_per_host_random_seed ( params . get ( "context" , None ) ) logging . info ( "eval_input_fn(): params=%s seed=%s" , params , seed ) ds = self . _load_dataset ( split = split ) # No filter, no rpeat. ds = ds . map ( functools . partial ( self . _eval_transform_fn , seed = seed ) ) # No shuffle. if "batch_size" in params : ds = ds . batch ( params [ "batch_size" ] , drop_remainder = True ) return ds . prefetch ( tf . contrib . data . AUTOTUNE )