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 __init__(
      self,
      model,
      data_hparams,
      config,
      model_hparams=None,
      train_hooks=None,
      eval_hooks=None,
      session_config=None,
  ):
      self._model = model
      self._data_hparams = maybe_hparams_to_dict(data_hparams)
      self._config = config
      self._train_hooks = train_hooks
      self._eval_hooks = eval_hooks
      self._session_config = session_config
  
      if model_hparams is None:
          model_hparams = model.hparams
      self._model_hparams = maybe_hparams_to_dict(model_hparams)
  
      self._estimator = tf.estimator.Estimator(
          model_fn=self._model,
          config=config,
          params=self._model_hparams,
      )
  
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 1 to create a new Executor object from inherited base classes: object with example: obj = Executor(model, data_hparams, config, model_hparams, train_hooks, eval_hooks, session_config)