class_docstr: Tests
  :func:`texar.tf.modules.decoders.beam_search_decode.beam_search_decode`.
class_docstr_tok: ["Tests",":","func",":","`","texar.tf.modules.decoders.beam_search_decode.beam_search_decode","`","."]
docstr: Tests beam search with RNNAttentionDecoder.
          
docstr_tok: ["Tests","beam","search","with","RNNAttentionDecoder","."]
code: def test_attention_decoder_beam_search(self):
      """Tests beam search with RNNAttentionDecoder."""
      seq_length = (
          np.random.randint(self._max_time, size=[self._batch_size]) + 1
      )
      encoder_values_length = tf.constant(seq_length)
      hparams = {
          "attention": {"kwargs": {"num_units": self._attention_dim}},
          "rnn_cell": {"kwargs": {"num_units": self._cell_dim}},
      }
      decoder = tx.modules.AttentionRNNDecoder(
          vocab_size=self._vocab_size,
          memory=self._encoder_output,
          memory_sequence_length=encoder_values_length,
          hparams=hparams,
      )
  
      self._test_beam_search(decoder)
  
file_path: texar/tests/modules/decoders/beam_search_decode_test.py
imports: import numpy
  import tensorflow
  from tensorflow.contrib.seq2seq import dynamic_decode
  from tensorflow.contrib.seq2seq import BeamSearchDecoder, tile_batch
  import texar.tf
  from texar.tf.modules.decoders.beam_search_decode import beam_search_decode
  from texar.tf import context
label_desc: Use image node_id 5 for calling the BeamSearchDecodeTest obj's underlying member method code with example usage: obj.test_attention_decoder_beam_search() without return types