class_docstr: Sequence-to-sequence base class.
class_docstr_tok: ["Sequence-to-sequence","base","class","."]
docstr: Create the model.
  
  Args:
    hparams: Hyperparameter configurations.
    mode: TRAIN | EVAL | INFER
    iterator: Dataset Iterator that feeds data.
    source_vocab_table: Lookup table mapping source words to ids.
    target_vocab_table: Lookup table mapping target words to ids.
    reverse_target_vocab_table: Lookup table mapping ids to target words. Only
      required in INFER mode. Defaults to None.
    scope: scope of the model.
    extra_args: model_helper.ExtraArgs, for passing customizable functions.
docstr_tok: ["Create","the","model",".","Args",":","hparams",":","Hyperparameter","configurations",".","mode",":","TRAIN","|","EVAL","|","INFER","iterator",":","Dataset","Iterator","that","feeds","data",".","source_vocab_table",":","Lookup","table","mapping","source","words","to","ids",".","target_vocab_table",":","Lookup","table","mapping","target","words","to","ids",".","reverse_target_vocab_table",":","Lookup","table","mapping","ids","to","target","words",".","Only","required","in","INFER","mode",".","Defaults","to","None",".","scope",":","scope","of","the","model",".","extra_args",":","model_helper.ExtraArgs",",","for","passing","customizable","functions","."]
code: def __init__(
      self,
      hparams,
      mode,
      iterator,
      source_vocab_table,
      target_vocab_table,
      reverse_target_vocab_table=None,
      scope=None,
      extra_args=None,
  ):
      """Create the model.
  
      Args:
        hparams: Hyperparameter configurations.
        mode: TRAIN | EVAL | INFER
        iterator: Dataset Iterator that feeds data.
        source_vocab_table: Lookup table mapping source words to ids.
        target_vocab_table: Lookup table mapping target words to ids.
        reverse_target_vocab_table: Lookup table mapping ids to target words. Only
          required in INFER mode. Defaults to None.
        scope: scope of the model.
        extra_args: model_helper.ExtraArgs, for passing customizable functions.
  
      """
      # Set params
      self._set_params_initializer(
          hparams,
          mode,
          iterator,
          source_vocab_table,
          target_vocab_table,
          scope,
          extra_args,
      )
  
      # Not used in general seq2seq models; when True, ignore decoder & training
      self.extract_encoder_layers = (
          hasattr(hparams, "extract_encoder_layers")
          and hparams.extract_encoder_layers
      )
  
      # Train graph
      res = self.build_graph(hparams, scope=scope)
      if not self.extract_encoder_layers:
          self._set_train_or_infer(
              res, reverse_target_vocab_table, hparams
          )
  
      # Saver
      self.saver = tf.train.Saver(
          tf.global_variables(), max_to_keep=hparams.num_keep_ckpts
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import collections
  import tensorflow
  from tensorflow.contrib.model_pruning import get_masks, get_thresholds
  from tensorflow.contrib.model_pruning.python import pruning
  from tensorflow.contrib.model_pruning.python.layers import core_layers
  from .None import model_helper
  from .utils import misc_utils, iterator_utils
label_desc: Use image node_id 1 to create a new BaseModel object from inherited base classes: object with example: obj = BaseModel(hparams, mode, iterator, source_vocab_table, target_vocab_table, reverse_target_vocab_table, scope, extra_args)