code: def __init__(self, args, alway_mask=False):
      super().__init__(args)
      self.args = args
      self.dropout = args.dropout
      self.embedding_dim = args.encoder_embed_dim
      self.feat_scale = math.sqrt(args.encoder_embed_dim)
      if args.no_scale_feature:
          self.feat_scale = 1.0
  
      subsample = ConvFeatureExtractionModel(
          conv_layers=eval(args.conv_feature_layers),
          dropout=0.0,
          mode=args.speech_extractor_mode,  # default, layer_norm
          conv_bias=args.speech_conv_bias,
      )
      self.feature_enc_layers = eval(args.conv_feature_layers)
      self.subsample = subsample
      self.feat_proj = (
          nn.Linear(self.feature_enc_layers[-1][0], self.embedding_dim)
          if self.feature_enc_layers[-1][0] != self.embedding_dim
          else None
      )
  
      self.feat_layer_norm = LayerNorm(self.feature_enc_layers[-1][0])
  
      self.embed_positions = nn.Conv1d(
          self.embedding_dim,
          self.embedding_dim,
          kernel_size=args.conv_pos,
          padding=args.conv_pos // 2,
          groups=args.conv_pos_groups,
      )
      std = math.sqrt(4 / (args.conv_pos * self.embedding_dim))
      nn.init.normal_(self.embed_positions.weight, mean=0, std=std)
      nn.init.constant_(self.embed_positions.bias, 0)
  
      self.embed_positions = nn.utils.weight_norm(
          self.embed_positions, name="weight", dim=2
      )
      self.embed_positions = nn.Sequential(
          self.embed_positions, SamePad(args.conv_pos), nn.GELU()
      )
  
      self.mask_prob = args.speech_mask_prob
      self.mask_selection = args.speech_mask_selection
      self.mask_other = args.speech_mask_other
      self.mask_length = args.speech_mask_length
      self.no_mask_overlap = args.speech_no_mask_overlap
      self.mask_min_space = args.speech_mask_min_space
  
      self.mask_channel_prob = args.speech_mask_channel_prob
      self.mask_channel_selection = args.speech_mask_channel_selection
      self.mask_channel_other = args.speech_mask_channel_other
      self.mask_channel_length = args.speech_mask_channel_length
      self.no_mask_channel_overlap = args.speech_no_mask_channel_overlap
      self.mask_channel_min_space = args.speech_mask_channel_min_space
  
      self.dropout_input = nn.Dropout(args.dropout_input)
      self.dropout_features = nn.Dropout(args.dropout_features)
  
      self.feature_grad_mult = args.feature_grad_mult
  
      self.mask_emb = nn.Parameter(
          torch.FloatTensor(args.encoder_embed_dim).uniform_()
      )
  
      self.layers = nn.ModuleList(
          [
              TransformerEncoderLayer(args)
              for _ in range(args.encoder_layers)
          ]
      )
      self.layer_norm = LayerNorm(args.encoder_embed_dim)
      self.normalize_before = args.encoder_normalize_before
      self.alway_mask = alway_mask
  
file_path: fairseq/fairseq/models/speech_to_text/s2t_wav_transformer.py
imports: import math
  import torch
  import torch.nn
  from fairseq.data.data_utils import compute_mask_indices
  from fairseq.models import FairseqEncoder
  from fairseq.models.wav2vec import ConvFeatureExtractionModel
  from fairseq.modules import GradMultiply, LayerNorm, SamePad, TransformerEncoderLayer
label_desc: Use image node_id 2 to create a new SpeechWavTransformerEncoder object from inherited base classes: FairseqEncoder with example: obj = SpeechWavTransformerEncoder(args, alway_mask)