class_docstr: The basic seq2seq model (without attention).
  
  Example:
  
      .. code-block:: python
  
          model = BasicSeq2seq(data_hparams, model_hparams)
          exor = tx.run.Executor(
              model=model,
              data_hparams=data_hparams,
              config=run_config)
          exor.train_and_evaluate(
              max_train_steps=10000,
              eval_steps=100)
  
  .. document private functions
  .. automethod:: _build
class_docstr_tok: ["The","basic","seq2seq","model","(","without","attention",")",".","Example",":","..","code-block",":",":","python","model","=","BasicSeq2seq","(","data_hparams",",","model_hparams",")","exor","=","tx.run.Executor","(","model=model",",","data_hparams=data_hparams",",","config=run_config",")","exor.train_and_evaluate","(","max_train_steps=10000",",","eval_steps=100",")","..","document","private","functions","..","automethod",":",":","_build"]
code: def _decode_infer(
      self, initial_state, encoder_results, features, labels, mode
  ):
      start_token = self._tgt_vocab.bos_token_id
      start_tokens = (
          tf.ones_like(features["source_length"]) * start_token
      )
  
      max_l = self._decoder.hparams.max_decoding_length_infer
  
      if self._hparams.beam_search_width > 1:
          return beam_search_decode(
              decoder_or_cell=self._decoder,
              embedding=self._tgt_embedder.embedding,
              start_tokens=start_tokens,
              end_token=self._tgt_vocab.eos_token_id,
              beam_width=self._hparams.beam_search_width,
              initial_state=initial_state,
              max_decoding_length=max_l,
          )
      else:
          return self._decoder(
              initial_state=initial_state,
              decoding_strategy=self._hparams.decoding_strategy_infer,
              embedding=self._tgt_embedder.embedding,
              start_tokens=start_tokens,
              end_token=self._tgt_vocab.eos_token_id,
              mode=mode,
          )
  
file_path: texar/texar/tf/models/seq2seq/basic_seq2seq.py
imports: import tensorflow
  from texar.tf.models.seq2seq.seq2seq_base import Seq2seqBase
  from texar.tf.modules.decoders.beam_search_decode import beam_search_decode
  from texar.tf.utils import utils
  from texar.tf.utils.shapes import get_batch_size
label_desc: Use image node_id 10 for calling the BasicSeq2seq obj's underlying member method code with example usage: obj._decode_infer(initial_state, encoder_results, features, labels, mode) and returns: beam_search_decode, self