class_docstr: Learns performance embedding and concatenates it with melody embedding.
class_docstr_tok: ["Learns","performance","embedding","and","concatenates","it","with","melody","embedding","."]
docstr: Encode transformer inputs, but concatenate mel w perf.
docstr_tok: ["Encode","transformer","inputs",",","but","concatenate","mel","w","perf","."]
code: def encode(
      self,
      perf_inputs,
      mel_inputs,
      target_space,
      hparams,
      features=None,
      losses=None,
  ):
      """Encode transformer inputs, but concatenate mel w perf."""
      del features, losses
      return mel_perf_transformer_encode(
          self._encoder_function,
          perf_inputs,
          mel_inputs,
          target_space,
          hparams,
          attention_weights=self.attention_weights,
          prepare_encoder_fn=self._prepare_encoder_fn,
      )
  
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 3 for calling the MelodyPerformanceTransformer obj's underlying member method code with example usage: obj.encode(perf_inputs, mel_inputs, target_space, hparams, features, losses) and returns: mel_perf_transformer_encode