class_docstr: Base class inherited by all seq2seq model classes.
  
  .. document private functions
  .. automethod:: _build
class_docstr_tok: ["Base","class","inherited","by","all","seq2seq","model","classes",".","..","document","private","functions","..","automethod",":",":","_build"]
docstr: Creates an input function `input_fn` that provides input data
  for the model in an :tf_main:`Estimator <estimator/Estimator>`.
  See, e.g., :tf_main:`tf.estimator.train_and_evaluate
  <estimator/train_and_evaluate>`.
  
  Args:
      mode: One of members in
          :tf_main:`tf.estimator.ModeKeys <estimator/ModeKeys>`.
      hparams: A `dict` or an :class:`~texar.tf.HParams` instance
          containing the hyperparameters of
          :class:`~texar.tf.data.PairedTextData`. See
          :meth:`~texar.tf.data.PairedTextData.default_hparams` for the
          the structure and default values of the hyperparameters.
  
  Returns:
      An input function that returns a tuple `(features, labels)`
      when called. `features` contains data fields that are related
      to source text, and `labels` contains data fields related
      to target text. See :class:`~texar.tf.data.PairedTextData` for
      all data fields.
docstr_tok: ["Creates","an","input","function","`","input_fn","`","that","provides","input","data","for","the","model","in","an",":","tf_main",":","`","Estimator","<","estimator\/Estimator",">","`",".","See",",","e.g.",",",":","tf_main",":","`","tf.estimator.train_and_evaluate","<","estimator\/train_and_evaluate",">","`",".","Args",":","mode",":","One","of","members","in",":","tf_main",":","`","tf.estimator.ModeKeys","<","estimator\/ModeKeys",">","`",".","hparams",":","A","`","dict","`","or","an",":","class",":","`","~texar.tf.HParams","`","instance","containing","the","hyperparameters","of",":","class",":","`","~texar.tf.data.PairedTextData","`",".","See",":","meth",":","`","~texar.tf.data.PairedTextData.default_hparams","`","for","the","the","structure","and","default","values","of","the","hyperparameters",".","Returns",":","An","input","function","that","returns","a","tuple","`","(","features",",","labels",")","`","when","called",".","`","features","`","contains","data","fields","that","are","related","to","source","text",",","and","`","labels","`","contains","data","fields","related","to","target","text",".","See",":","class",":","`","~texar.tf.data.PairedTextData","`","for","all","data","fields","."]
code: def get_input_fn(self, mode, hparams=None):
      """Creates an input function `input_fn` that provides input data
      for the model in an :tf_main:`Estimator <estimator/Estimator>`.
      See, e.g., :tf_main:`tf.estimator.train_and_evaluate
      <estimator/train_and_evaluate>`.
  
      Args:
          mode: One of members in
              :tf_main:`tf.estimator.ModeKeys <estimator/ModeKeys>`.
          hparams: A `dict` or an :class:`~texar.tf.HParams` instance
              containing the hyperparameters of
              :class:`~texar.tf.data.PairedTextData`. See
              :meth:`~texar.tf.data.PairedTextData.default_hparams` for the
              the structure and default values of the hyperparameters.
  
      Returns:
          An input function that returns a tuple `(features, labels)`
          when called. `features` contains data fields that are related
          to source text, and `labels` contains data fields related
          to target text. See :class:`~texar.tf.data.PairedTextData` for
          all data fields.
      """
  
      def _input_fn():
          data = PairedTextData(hparams)
  
          iterator = data.dataset.make_initializable_iterator()
          tf.add_to_collection(
              tf.GraphKeys.TABLE_INITIALIZERS, iterator.initializer
          )
  
          batch = iterator.get_next()
  
          features, labels = {}, {}
          for key, value in batch.items():
              if key.startswith("source_"):
                  features[key] = value
              else:
                  labels[key] = value
          return features, labels
  
      return _input_fn
  
imports: import tensorflow
  from texar.tf.models.model_base import ModelBase
  from texar.tf.losses.mle_losses import sequence_sparse_softmax_cross_entropy
  from texar.tf.data.data.paired_text_data import PairedTextData
  from texar.tf.core.optimization import get_train_op
  from texar.tf.hyperparams import HParams
  from texar.tf.utils import utils
  from texar.tf.utils.variables import collect_trainable_variables
label_desc: Use image node_id 18 for calling the Seq2seqBase obj's underlying member method code with example usage: obj.get_input_fn(mode, hparams) and returns: _input_fn, features,  labels