code: def testSlowVsFast(self):
      tf.set_random_seed(1234)
      model, features = get_model(transformer.transformer_tiny())
  
      decode_length = DECODE_LENGTH
  
      out_logits, _ = model(features)
      out_logits = tf.squeeze(out_logits, axis=[2, 3])
      loss = tf.nn.sparse_softmax_cross_entropy_with_logits(
          logits=tf.reshape(out_logits, [-1, VOCAB_SIZE]),
          labels=tf.reshape(features["targets"], [-1]),
      )
      loss = tf.reduce_mean(loss)
      apply_grad = tf.train.AdamOptimizer(0.001).minimize(loss)
  
      with self.test_session():
          tf.global_variables_initializer().run()
          for _ in range(10):
              apply_grad.run()
  
      model.set_mode(tf_estimator.ModeKeys.PREDICT)
  
      with tf.variable_scope(tf.get_variable_scope(), reuse=True):
          greedy_result = model._slow_greedy_infer(
              features, decode_length
          )["outputs"]
          greedy_result = tf.squeeze(greedy_result, axis=[2, 3])
  
          fast_result = model._greedy_infer(features, decode_length)[
              "outputs"
          ]
  
      with self.test_session():
          greedy_res = greedy_result.eval()
          fast_res = fast_result.eval()
  
      self.assertEqual(
          fast_res.shape, (BATCH_SIZE, INPUT_LENGTH + decode_length)
      )
      self.assertAllClose(greedy_res, fast_res)
  
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 evolved_transformer
  from tensor2tensor.models import transformer
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the EvolvedTransformerTest obj's underlying member method code with example usage: obj.testSlowVsFast() without return types