docstr: Test a Translation Nas Net model.
docstr_tok: ["Test","a","Translation","Nas","Net","model","."]
code: def _test_model(self, model_cls, hparams):
      """Test a Translation Nas Net model."""
      tf.reset_default_graph()
  
      hparams.filter_size = 32
      hparams.num_heads = 1
      hparams.layer_prepostprocess_dropout = 0.0
      hparams.hidden_size = _HIDDEN_SIZE
  
      p_hparams = problem_hparams.test_problem_hparams(
          _VOCAB_SIZE, _VOCAB_SIZE, hparams
      )
      hparams.problems = [p_hparams]
  
      inputs = -1 + np.random.random_integers(
          _VOCAB_SIZE, size=(_BATCH_SIZE, _INPUT_LENGTH, 1, 1)
      )
      targets = -1 + np.random.random_integers(
          _VOCAB_SIZE, size=(_BATCH_SIZE, _TARGET_LENGTH, 1, 1)
      )
      features = {
          "inputs": tf.constant(inputs, dtype=tf.int32, name="inputs"),
          "targets": tf.constant(
              targets, dtype=tf.int32, name="targets"
          ),
          "target_space_id": tf.constant(1, dtype=tf.int32),
      }
  
      model = model_cls(hparams, tf_estimator.ModeKeys.TRAIN, p_hparams)
      logits, _ = model(features)
      with self.test_session() as session:
          session.run(tf.global_variables_initializer())
          res = session.run(logits)
      self.assertEqual(
          res.shape, (_BATCH_SIZE, _TARGET_LENGTH, 1, 1, _VOCAB_SIZE)
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  from tensor2tensor.data_generators import problem_hparams
  from tensor2tensor.layers import common_attention
  from tensor2tensor.models import transformer
  from tensor2tensor.models.neural_architecture_search import nas_layers
  from tensor2tensor.models.neural_architecture_search import nas_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the NasSeq2SeqTest obj's underlying member method code with example usage: obj._test_model(model_cls, hparams) without return types