class_docstr: Tests :class:`~texar.torch.modules.GPT2Decoder`
      
docstr: Tests infer_greedy
          
code: def test_decode_infer_greedy(self):
      r"""Tests infer_greedy"""
      hparams = {"pretrained_model_name": None}
      decoder = GPT2Decoder(hparams=hparams)
  
      start_tokens = tf.fill([16], 1)
      end_token = 2
      outputs, length = decoder(
          max_decoding_length=4,
          start_tokens=start_tokens,
          end_token=end_token,
          decoding_strategy="infer_greedy",
      )
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          outputs_ = sess.run(outputs)
          self.assertIsInstance(outputs_, TransformerDecoderOutput)
  
file_path: texar/tests/modules/decoders/gpt2_decoder_test.py
imports: import tensorflow
  from texar.tf.modules.decoders.gpt2_decoder import GPT2Decoder
  from texar.tf.modules.decoders.transformer_decoders import TransformerDecoderOutput
  from texar.tf.utils.test import pretrained_test
label_desc: Use image node_id 4 for calling the GPT2DecoderTest obj's underlying member method code with example usage: obj.test_decode_infer_greedy() without return types