class_docstr: Autoencoder-augmented Transformer.
class_docstr_tok: ["Autoencoder-augmented","Transformer","."]
code: def prepare_features_for_infer(self, features):
      if self._hparams.do_mask or not self._hparams.do_ae:
          return features
      beam_batch_size = self._decode_hparams.beam_size
      beam_batch_size *= self._decode_hparams.batch_size
      inputs = tf.zeros(
          [beam_batch_size, 1, 1, self._hparams.hidden_size]
      )
      inputs = inputs if "inputs" in features else None
      if self._hparams.drop_inputs or not self.has_input:
          inputs = None
      targets = tf.zeros(
          [beam_batch_size, 1, 1, self._hparams.hidden_size]
      )
      with tf.variable_scope("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
  import math
  import os
  from six.moves import range
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_image_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import discretization
  from tensor2tensor.layers import latent_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import beam_search
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import expert_utils
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 3 for calling the TransformerAE obj's underlying member method code with example usage: obj.prepare_features_for_infer(features) and returns: features