class_docstr: Extract features from audio
  
  Args:
      conv_layers (nn.ModuleList):
          convolution layers
class_docstr_tok: ["Extract","features","from","audio","Args",":","conv_layers","(","nn.ModuleList",")",":","convolution","layers"]
docstr: Args:
      x (Tensor):
          Input Tensor representing a batch of audio,
          shape: ``[batch, time]``.
      length (Tensor or None, optional):
          Valid length of each input sample. shape: ``[batch, ]``.
  
  Returns:
      Tensor:
          The resulting feature, shape: ``[batch, frame, feature]``
      Optional[Tensor]:
          Valid length of each output sample. shape: ``[batch, ]``.
docstr_tok: ["Args",":","x","(","Tensor",")",":","Input","Tensor","representing","a","batch","of","audio",",","shape",":","``","[","batch",",","time","]","``",".","length","(","Tensor","or","None",",","optional",")",":","Valid","length","of","each","input","sample",".","shape",":","``","[","batch",",","]","``",".","Returns",":","Tensor",":","The","resulting","feature",",","shape",":","``","[","batch",",","frame",",","feature","]","``","Optional","[","Tensor","]",":","Valid","length","of","each","output","sample",".","shape",":","``","[","batch",",","]","``","."]
code: def forward(
      self,
      x: Tensor,
      length: Optional[Tensor],
  ) -> Tuple[Tensor, Optional[Tensor]]:
      """
      Args:
          x (Tensor):
              Input Tensor representing a batch of audio,
              shape: ``[batch, time]``.
          length (Tensor or None, optional):
              Valid length of each input sample. shape: ``[batch, ]``.
  
      Returns:
          Tensor:
              The resulting feature, shape: ``[batch, frame, feature]``
          Optional[Tensor]:
              Valid length of each output sample. shape: ``[batch, ]``.
      """
      if x.ndim != 2:
          raise ValueError(
              f"Expected the input Tensor to be 2D (batch, time). Found: {list(x.shape)}"
          )
  
      x = x.unsqueeze(1)  # (batch, channel==1, frame)
      for layer in self.conv_layers:
          x, length = layer(x, length)  # (batch, feature, frame)
      x = x.transpose(1, 2)  # (batch, frame, feature)
      return x, length
  
imports: import logging
  from typing import List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torch.nn import Module, Parameter
  from .wavlm_attention import WavLMSelfAttention
label_desc: Use image node_id 2 for calling the FeatureExtractor obj's underlying member method code with example usage: obj.forward(x, length) and returns: x,  length