class_docstr: Tests :class:`~texar.tf.modules.decoders.rnn_decoders.BasicRNNDecoder`.
      
code: def _test_outputs(
      self,
      decoder,
      outputs,
      final_state,
      sequence_lengths,
      test_mode=False,
  ):
      # 4 trainable variables: cell-kernel, cell-bias,
      # fc-layer-weights, fc-layer-bias
      self.assertEqual(len(decoder.trainable_variables), 4)
  
      cell_dim = decoder.hparams.rnn_cell.kwargs.num_units
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
  
          outputs_, final_state_, sequence_lengths_ = sess.run(
              [outputs, final_state, sequence_lengths],
              feed_dict={
                  context.global_mode(): tf.estimator.ModeKeys.TRAIN
              },
          )
          self.assertIsInstance(outputs_, BasicRNNDecoderOutput)
          if not test_mode:
              self.assertEqual(
                  outputs_.logits.shape,
                  (self._batch_size, self._max_time, self._vocab_size),
              )
              self.assertEqual(
                  outputs_.sample_id.shape,
                  (self._batch_size, self._max_time),
              )
              np.testing.assert_array_equal(
                  sequence_lengths_, [self._max_time] * self._batch_size
              )
          self.assertEqual(
              final_state_[0].shape, (self._batch_size, cell_dim)
          )
  
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 2 for calling the BasicRNNDecoderTest obj's underlying member method code with example usage: obj._test_outputs(decoder, outputs, final_state, sequence_lengths, test_mode) without return types