class_docstr: Tests :class:`~texar.torch.modules.GPT2Decoder`
      
docstr: Tests train_greedy.
          
code: def test_decode_train(self):
      r"""Tests train_greedy."""
      hparams = {"pretrained_model_name": None}
      decoder = GPT2Decoder(hparams=hparams)
  
      max_time = 8
      batch_size = 16
      inputs = tf.random_uniform(
          [batch_size, max_time], maxval=50257, dtype=tf.int32
      )
      outputs = decoder(inputs=inputs)
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          outputs_ = sess.run(outputs)
          self.assertEqual(
              outputs_.logits.shape, (batch_size, max_time, 50257)
          )
          self.assertEqual(
              outputs_.sample_id.shape, (batch_size, max_time)
          )
  
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 3 for calling the GPT2DecoderTest obj's underlying member method code with example usage: obj.test_decode_train() without return types