class_docstr: Tests :class:`~texar.tf.modules.decoders.rnn_decoders.BasicRNNDecoder`.
      
docstr: Tests decoding in training mode.
          
docstr_tok: ["Tests","decoding","in","training","mode","."]
code: def test_decode_train(self):
      """Tests decoding in training mode."""
      output_layer = tf.layers.Dense(self._vocab_size)
      decoder = BasicRNNDecoder(
          vocab_size=self._vocab_size, output_layer=output_layer
      )
  
      helper_train = get_helper(
          decoder.hparams.helper_train.type,
          inputs=self._inputs,
          sequence_length=[self._max_time] * self._batch_size,
          **decoder.hparams.helper_train.kwargs.todict(),
      )
      outputs, final_state, sequence_lengths = decoder(
          helper=helper_train
      )
      self._test_outputs(
          decoder, outputs, final_state, sequence_lengths
      )
  
      outputs, final_state, sequence_lengths = decoder(
          inputs=self._inputs,
          sequence_length=[self._max_time] * self._batch_size,
      )
      self._test_outputs(
          decoder, outputs, final_state, sequence_lengths
      )
  
      outputs, final_state, sequence_lengths = decoder(
          decoding_strategy=None,
          inputs=self._inputs,
          sequence_length=[self._max_time] * self._batch_size,
      )
      self._test_outputs(
          decoder, outputs, final_state, sequence_lengths
      )
  
      outputs, final_state, sequence_lengths = decoder(
          decoding_strategy=None,
          embedding=self._embedding,
          start_tokens=[1] * self._batch_size,
          end_token=2,
          mode=tf.estimator.ModeKeys.EVAL,
      )
      self._test_outputs(
          decoder,
          outputs,
          final_state,
          sequence_lengths,
          test_mode=True,
      )
  
imports: import numpy
  import tensorflow
  from texar.tf.modules.decoders.rnn_decoders import BasicRNNDecoderOutput
  from texar.tf.modules.decoders.rnn_decoders import BasicRNNDecoder
  from texar.tf.modules.decoders.rnn_decoders import AttentionRNNDecoderOutput
  from texar.tf.modules.decoders.rnn_decoders import AttentionRNNDecoder
  from texar.tf.modules.decoders.rnn_decoder_helpers import get_helper
  from texar.tf import context
label_desc: Use image node_id 4 for calling the BasicRNNDecoderTest obj's underlying member method code with example usage: obj.test_decode_train() without return types