class_docstr: Extracts features from raw audio waveforms and embeds them in a latent
  space as described in Section 2 of
  :cite:t:`https://doi.org/10.48550/arxiv.2006.11477`.
class_docstr_tok: ["Extracts","features","from","raw","audio","waveforms","and","embeds","them","in","a","latent","space","as","described","in","Section","2","of",":","cite",":","t",":","`","https",":","\/\/doi.org\/10.48550\/arxiv.2006.11477","`","."]
docstr: See the base :meth:`SequenceFeatureExtractor.forward`.
  
  :param seqs:
      The input waveforms. *Shape:* :math:`(N,S)`, where :math:`N` is the
      batch size and :math:`(S)` is the sequence length.
docstr_tok: ["See","the","base",":","meth",":","`","SequenceFeatureExtractor.forward","`",".",":","param","seqs",":","The","input","waveforms",".","*","Shape",":","*",":","math",":","`","(","N",",","S",")","`",",","where",":","math",":","`","N","`","is","the","batch","size","and",":","math",":","`","(","S",")","`","is","the","sequence","length","."]
code: def forward(
      self, seqs: Tensor, padding_mask: Optional[PaddingMask]
  ) -> Tuple[Tensor, Optional[PaddingMask]]:
      """See the base :meth:`SequenceFeatureExtractor.forward`.
  
      :param seqs:
          The input waveforms. *Shape:* :math:`(N,S)`, where :math:`N` is the
          batch size and :math:`(S)` is the sequence length.
      """
      # (N, S) -> (N, C, S)
      seqs = seqs.unsqueeze(1)
  
      # (N, C, S) -> (N, E, S)
      features = self.layers(seqs)
  
      if self.grad_scale != 1.0:
          features = scale_grad(features, self.grad_scale)
  
      # (N, E, S) -> (N, S, E)
      features = features.transpose(1, 2)
  
      # Since we contracted the temporal dimension, we should re-compute
      # the sequence lengths.
      if padding_mask is not None:
          seq_lens = self._contract_seq_lens(padding_mask.seq_lens)
  
          padding_mask = PaddingMask(
              seq_lens, batch_seq_len=features.size(1)
          )
  
      return features, padding_mask
  
imports: from typing import List, Optional, Sequence, Tuple, final
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import GELU, Conv1d, Dropout, GroupNorm, Module, Sequential
  from torch.nn.functional import group_norm, layer_norm
  from fairseq2.models.feature_extractor import SequenceFeatureExtractor
  from fairseq2.nn.normalization import LayerNorm
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.nn.utils.grad import scale_grad
  from fairseq2.typing import DataType, Device, finaloverride, override
label_desc: Use image node_id 2 for calling the Wav2Vec2FeatureExtractor obj's underlying member method code with example usage: obj.forward(seqs, padding_mask) and returns: features,  padding_mask