code: def testNeuralGPU(self):
      hparams = common_hparams.basic_params1()
      batch_size = 3
      input_length = 5
      target_length = input_length
      input_vocab_size = 9
      target_vocab_size = 11
      p_hparams = problem_hparams.test_problem_hparams(
          input_vocab_size, target_vocab_size, hparams
      )
      inputs = np.random.randint(
          input_vocab_size, size=(batch_size, input_length, 1, 1)
      )
      targets = np.random.randint(
          target_vocab_size, size=(batch_size, target_length, 1, 1)
      )
      with self.test_session() as session:
          features = {
              "inputs": tf.constant(inputs, dtype=tf.int32),
              "targets": tf.constant(targets, dtype=tf.int32),
          }
          model = neural_gpu.NeuralGPU(
              hparams, tf_estimator.ModeKeys.TRAIN, p_hparams
          )
          logits, _ = model(features)
          session.run(tf.global_variables_initializer())
          res = session.run(logits)
      self.assertEqual(
          res.shape,
          (batch_size, target_length, 1, 1, target_vocab_size),
      )
  
file_path: tensor2tensor/tensor2tensor/models/neural_gpu_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.data_generators import problem_hparams
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.models import neural_gpu
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the NeuralGPUTest obj's underlying member method code with example usage: obj.testNeuralGPU() without return types