class_docstr: This class serves as an `input_fn` for the `tf.estimator` framework.
class_docstr_tok: ["This","class","serves","as","an","`","input_fn","`","for","the","`","tf.estimator","`","framework","."]
docstr: Implementation of `input_fn` contract for prediction mode.
  
  Args:
    params: a dict containing an integer value for key 'batch_size'.
  
  Returns:
    the tuple (features, labels), where:
      - features is a dict of Tensor-valued input features; keys populated
        are:
          'image'
          'variant'
          'alt_allele_indices'
  
        Aside from 'image', these may be encoded specially for TPU.
docstr_tok: ["Implementation","of","`","input_fn","`","contract","for","prediction","mode",".","Args",":","params",":","a","dict","containing","an","integer","value","for","key","'batch_size","'",".","Returns",":","the","tuple","(","features",",","labels",")",",","where",":","-","features","is","a","dict","of","Tensor-valued","input","features",";","keys","populated","are",":","'image'","'variant'","'alt_allele_indices'","Aside","from","'image","'",",","these","may","be","encoded","specially","for","TPU","."]
code: def prediction_input_fn(self, params):
      """Implementation of `input_fn` contract for prediction mode.
  
      Args:
        params: a dict containing an integer value for key 'batch_size'.
  
      Returns:
        the tuple (features, labels), where:
          - features is a dict of Tensor-valued input features; keys populated
            are:
              'image'
              'variant'
              'alt_allele_indices'
  
            Aside from 'image', these may be encoded specially for TPU.
      """
  
      def load_dataset(filename):
          dataset = tf.data.TFRecordDataset(
              filename,
              buffer_size=self.prefetch_dataset_buffer_size,
              compression_type=compression_type,
          )
          return dataset
  
      batch_size = params["batch_size"]
      compression_type = dv_utils.compression_type_of_files(
          self.input_files
      )
      dataset = tf.data.Dataset.list_files(
          sharded_file_utils.normalize_to_sharded_file_pattern(
              self.input_file_spec
          ),
          shuffle=False,
      )
      logging.vlog(
          3,
          "self.input_read_threads={}".format(self.input_read_threads),
      )
      if self.sloppy:
          options = tf.data.Options()
          options.experimental_deterministic = False
          dataset = dataset.with_options(options)
      dataset = dataset.interleave(
          load_dataset,
          cycle_length=self.input_read_threads,
          num_parallel_calls=tf.data.AUTOTUNE,
      )
      dataset = dataset.map(
          map_func=self.parse_tfexample,
          num_parallel_calls=tf.data.AUTOTUNE,
      )
      dataset = dataset.batch(batch_size=batch_size)
      dataset = dataset.prefetch(tf.data.AUTOTUNE)
      return dataset
  
imports: import itertools
  from typing import Callable, Optional, Tuple
  from absl import logging
  import ml_collections
  import tensorflow
  from tensorflow import estimator
  from deepvariant import dv_constants
  from deepvariant import dv_utils
  from deepvariant import keras_modeling
  from deepvariant.protos import deepvariant_pb2
  from google.protobuf import text_format
  from third_party.nucleus.io import sharded_file_utils
label_desc: Use image node_id 5 for calling the DeepVariantInput obj's underlying member method code with example usage: obj.prediction_input_fn(params) and returns: dataset, dataset