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.
docstr: Trains the model. See :tf_main:`tf.estimator.Estimator.train
  <estimator/Estimator#train>` for more details.
  
  Args:
      max_steps (int, optional): Total number of steps for which
          to train model. If `None`, train forever or until the train
          data generates the OutOfRange exception. If OutOfRange occurs
          in the middle, training stops before :attr:`max_steps` steps.
code: def train(self, max_steps=None):
      """Trains the model. See :tf_main:`tf.estimator.Estimator.train
      <estimator/Estimator#train>` for more details.
  
      Args:
          max_steps (int, optional): Total number of steps for which
              to train model. If `None`, train forever or until the train
              data generates the OutOfRange exception. If OutOfRange occurs
              in the middle, training stops before :attr:`max_steps` steps.
      """
      train_spec = self._get_train_spec(max_steps=max_steps)
      self._estimator.train(
          input_fn=train_spec.input_fn,
          hooks=train_spec.hooks,
          max_steps=train_spec.max_steps,
      )
  
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 4 for calling the Executor obj's underlying member method code with example usage: obj.train(max_steps) without return types