code: def _test_xception(self, img_size):
      vocab_size = 9
      batch_size = 3
      x = np.random.randint(
          256, size=(batch_size, img_size, img_size, 3)
      )
      y = np.random.randint(
          1, high=vocab_size, size=(batch_size, 1, 1, 1)
      )
      hparams = xception.xception_tiny()
      p_hparams = problem_hparams.test_problem_hparams(
          vocab_size, vocab_size, hparams
      )
      p_hparams.modality["inputs"] = modalities.ModalityType.IMAGE
      p_hparams.modality[
          "targets"
      ] = modalities.ModalityType.CLASS_LABEL
      with self.test_session() as session:
          features = {
              "inputs": tf.constant(x, dtype=tf.int32),
              "targets": tf.constant(y, dtype=tf.int32),
          }
          model = xception.Xception(
              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, 1, 1, 1, vocab_size))
  
file_path: tensor2tensor/tensor2tensor/models/xception_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 modalities
  from tensor2tensor.models import xception
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the XceptionTest obj's underlying member method code with example usage: obj._test_xception(img_size) without return types