class_docstr: Tests :class:`~texar.tf.modules.TransformerDecoder`
      
class_docstr_tok: ["Tests",":","class",":","`","~texar.tf.modules.TransformerDecoder","`"]
docstr: Tests beam_search
          
docstr_tok: ["Tests","beam_search"]
code: def test_beam_search(self):
      """Tests beam_search"""
      decoder = TransformerDecoder(
          vocab_size=self._vocab_size, output_layer=self._output_layer
      )
  
      outputs = decoder(
          memory=self._memory,
          memory_sequence_length=self._memory_sequence_length,
          memory_attention_bias=None,
          inputs=None,
          embedding=self._embedding_fn,
          beam_width=5,
          start_tokens=self._start_tokens,
          end_token=self._end_token,
          max_decoding_length=self._max_decode_len,
          mode=tf.estimator.ModeKeys.PREDICT,
      )
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          outputs_ = sess.run(outputs)
          self.assertEqual(
              outputs_["log_prob"].shape, (self._batch_size, 5)
          )
          self.assertEqual(
              outputs_["sample_id"].shape,
              (self._batch_size, self._max_decode_len, 5),
          )
  
file_path: texar/tests/modules/decoders/transformer_decoders_test.py
imports: import tensorflow
  from texar.tf.modules.decoders.transformer_decoders import TransformerDecoder
  from texar.tf.modules.decoders.transformer_decoders import TransformerDecoderOutput
  from texar.tf.modules.decoders import tf_helpers
label_desc: Use image node_id 7 for calling the TransformerDecoderTest obj's underlying member method code with example usage: obj.test_beam_search() without return types