code: def __init__(self, args, src_dict, embed_speaker):
      super().__init__(src_dict)
      self.args = args
      self.padding_idx = src_dict.pad()
      self.n_frames_per_step = args.n_frames_per_step
      self.out_dim = args.output_frame_dim * args.n_frames_per_step
  
      self.embed_speaker = embed_speaker
      self.spk_emb_proj = None
      if embed_speaker is not None:
          self.spk_emb_proj = nn.Linear(
              args.encoder_embed_dim + args.speaker_embed_dim,
              args.encoder_embed_dim,
          )
  
      self.dropout_module = FairseqDropout(
          p=args.dropout, module_name=self.__class__.__name__
      )
      self.embed_tokens = Embedding(
          len(src_dict),
          args.encoder_embed_dim,
          padding_idx=self.padding_idx,
      )
  
      self.embed_positions = PositionalEmbedding(
          args.max_source_positions,
          args.encoder_embed_dim,
          self.padding_idx,
      )
      self.pos_emb_alpha = nn.Parameter(torch.ones(1))
      self.dec_pos_emb_alpha = nn.Parameter(torch.ones(1))
  
      self.encoder_fft_layers = nn.ModuleList(
          FFTLayer(
              args.encoder_embed_dim,
              args.encoder_attention_heads,
              args.fft_hidden_dim,
              args.fft_kernel_size,
              dropout=args.dropout,
              attention_dropout=args.attention_dropout,
          )
          for _ in range(args.encoder_layers)
      )
  
      self.var_adaptor = VarianceAdaptor(args)
  
      self.decoder_fft_layers = nn.ModuleList(
          FFTLayer(
              args.decoder_embed_dim,
              args.decoder_attention_heads,
              args.fft_hidden_dim,
              args.fft_kernel_size,
              dropout=args.dropout,
              attention_dropout=args.attention_dropout,
          )
          for _ in range(args.decoder_layers)
      )
  
      self.out_proj = nn.Linear(args.decoder_embed_dim, self.out_dim)
  
      self.postnet = None
      if args.add_postnet:
          self.postnet = Postnet(
              self.out_dim,
              args.postnet_conv_dim,
              args.postnet_conv_kernel_size,
              args.postnet_layers,
              args.postnet_dropout,
          )
  
      self.apply(model_init)
  
imports: import logging
  import torch
  from torch import nn
  from fairseq import utils
  from fairseq.data.data_utils import lengths_to_padding_mask
  from fairseq.models import FairseqEncoder, FairseqEncoderModel, register_model, register_model_architecture
  from fairseq.models.text_to_speech.hub_interface import TTSHubInterface
  from fairseq.models.text_to_speech.tacotron2 import Postnet
  from fairseq.modules import FairseqDropout, LayerNorm, MultiheadAttention, PositionalEmbedding
label_desc: Use image node_id 1 to create a new FastSpeech2Encoder object from inherited base classes: FairseqEncoder with example: obj = FastSpeech2Encoder(args, src_dict, embed_speaker)