class_docstr: Nonautoregressive Transformer from https://arxiv.org/abs/1805.11063.
class_docstr_tok: ["Nonautoregressive","Transformer","from","https",":","\/\/arxiv.org\/abs\/1805.11063","."]
code: def prepare_features_for_infer(self, features):
      batch_size = self._decode_hparams.batch_size
      inputs = tf.zeros([batch_size, 1, 1, self._hparams.hidden_size])
      inputs = inputs if "inputs" in features else None
      targets = tf.zeros([batch_size, 1, 1, self._hparams.hidden_size])
      with tf.variable_scope("transformer_nat/body"):
          _, _, cache = ae_transformer_internal(
              inputs,
              targets,
              features["target_space_id"],
              self._hparams,
          )
      features["cache_raw"] = cache
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  from six.moves import range
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import beam_search
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 3 for calling the TransformerNAT obj's underlying member method code with example usage: obj.prepare_features_for_infer(features) without return types