class_docstr: Class that executes training, evaluation, prediction, export, and other
  actions of :tf_main:`Estimator <estimator/Estimator>`.
  
  Args:
      model: An instance of a subclass of
          :class:`~texar.tf.models.model_base.ModelBase`.
      data_hparams: A `dict` or an instance of :class:`~texar.tf.hparams.HParams`
          containing the hyperparameters of data. It must contain `train`
          and/or `eval` fields for relevant processes. For example, for
          :meth:`train_and_evaluate`, both fields are required.
      config: An instance of
          :tf_main:`tf.estimator.RunConfig <estimator/RunConfig>`, used as
          the :attr:`config` argument of
          :tf_main:`Estimator <estimator/Estimator#__init__>`.
      model_hparams (optional): A `dict` or an instance of
          :class:`~texar.tf.hparams.HParams` containing the hyperparameters of
          the model. If `None`, uses :attr:`model.hparams`. Used as
          the :attr:`params` argument of
          :tf_main:`Estimator <estimator/Estimator#__init__>`.
      train_hooks (optional): Iterable of :tf_main:`tf.train.SessionRunHook
          <train/SessionRunHook>` objects to run during training.
      eval_hooks (optional): Iterable of :tf_main:`tf.train.SessionRunHook
          <train/SessionRunHook>` objects to run during evaluation.
      session_config (optional): An instance of
          :tf_main:`tf.ConfigProto <ConfigProto>`, used as the :attr:`config`
          argument of :tf_main:`tf session <Session>`.
  
  Example:
  
      .. code-block:: python
  
          model = BasicSeq2seq(data_hparams, model_hparams)
          exor = Executor(
              model=model,
              data_hparams=data_hparams,
              config=run_config)
          exor.train_and_evaluate(
              max_train_steps=10000,
              eval_steps=100)
  
  See `bin/train.py` for the usage in detail.
code: def _get_train_spec(self, max_steps=None):
      if "train" not in self._data_hparams:
          raise ValueError(
              "`data_hparams` must contain field `train` for "
              "training data config."
          )
      input_fn = self._model.get_input_fn(
          mode=tf.estimator.ModeKeys.TRAIN,
          hparams=self._data_hparams["train"],
      )
      return tf.estimator.TrainSpec(
          input_fn=input_fn,
          max_steps=max_steps,
          hooks=self._train_hooks,
      )
  
file_path: texar/texar/tf/run/executor.py
imports: import tensorflow
  from texar.tf.utils.dtypes import maybe_hparams_to_dict
label_desc: Use image node_id 2 for calling the Executor obj's underlying member method code with example usage: obj._get_train_spec(max_steps) and returns: tf