class_docstr: A csv data provider.
class_docstr_tok: ["A","csv","data","provider","."]
docstr: See `data.Provider` get_input_fn.
docstr_tok: ["See","`","data.Provider","`","get_input_fn","."]
code: def get_input_fn(self, hparams, mode, batch_size):
      """See `data.Provider` get_input_fn."""
      del hparams
  
      def input_fn(params=None):
          """Provides batches of data."""
          del params
          filename = self._filename
          if (
              self._validation_filename
              and mode != tf.estimator.ModeKeys.TRAIN
          ):
              filename = self._validation_filename
  
          features_dataset = tf.data.experimental.CsvDataset(
              filename,
              record_defaults=self._record_defaults,
              header=True,
              field_delim=self._field_delim,
              use_quote_delim=True,
          )
  
          def _map_fn(*args):
              features = {
                  str(i): tensor for i, tensor in enumerate(args)
              }
              label = features.pop(str(self._label_index))
              return features, label
  
          features_dataset = (
              features_dataset.map(_map_fn)
              .prefetch(tf.data.experimental.AUTOTUNE)
              .batch(batch_size)
          )
          if mode == tf.estimator.ModeKeys.TRAIN:
              features_dataset = features_dataset.repeat().shuffle(
                  100 * batch_size
              )
  
          return features_dataset
  
      return input_fn
  
file_path: model_search/model_search/data/csv_data_for_binary.py
imports: from absl import flags
  from model_search.data import data
  import numpy
  import pandas
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling the Provider obj's underlying member method code with example usage: obj.get_input_fn(hparams, mode, batch_size) and returns: input_fn, features_dataset, features,  label