class_docstr: Transformer Autoencoder, which uses a single performance encoding.
class_docstr_tok: ["Transformer","Autoencoder",",","which","uses","a","single","performance","encoding","."]
code: def __init__(self, *args, **kwargs):
      super(PerformanceTransformer, self).__init__(*args, **kwargs)
      self.attention_weights = {}  # For visualizing attention heads.
      self.recurrent_memory_by_layer = (
          None  # Override to enable recurrent memory
      )
      self._encoder_function = transformer_encoder
      self._decoder_function = transformer_decoder
      self._init_cache_fn = _init_transformer_cache
      self._prepare_encoder_fn = transformer_prepare_encoder
      self._prepare_decoder_fn = transformer_prepare_decoder
  
imports: from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.layers import transformer_layers
  from tensor2tensor.models.transformer import Transformer, transformer_decoder, transformer_prepare_encoder, transformer_prepare_decoder, features_to_nonpadding, _init_transformer_cache
  from tensor2tensor.utils import mlperf_log
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 to create a new PerformanceTransformer object from inherited base classes: Transformer with example: obj = PerformanceTransformer()