code: def testLSTMSeq2SeqAttention(self):
      vocab_size = 9
      x = np.random.randint(1, high=vocab_size, size=(3, 5, 1, 1))
      y = np.random.randint(1, high=vocab_size, size=(3, 6, 1, 1))
      hparams = lstm.lstm_attention()
  
      p_hparams = problem_hparams.test_problem_hparams(
          vocab_size, vocab_size, hparams
      )
      x = tf.constant(x, dtype=tf.int32)
      x = tf.placeholder_with_default(x, shape=[None, None, 1, 1])
  
      with self.test_session() as session:
          features = {
              "inputs": x,
              "targets": tf.constant(y, dtype=tf.int32),
          }
          model = lstm.LSTMSeq2seqAttention(
              hparams, tf_estimator.ModeKeys.TRAIN, p_hparams
          )
          logits, _ = model(features)
          session.run(tf.global_variables_initializer())
          res = session.run(logits)
      self.assertEqual(res.shape, (3, 6, 1, 1, vocab_size))
  
file_path: tensor2tensor/tensor2tensor/models/lstm_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.models import lstm
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the LSTMTest obj's underlying member method code with example usage: obj.testLSTMSeq2SeqAttention() without return types