class_docstr: Mel-Spectrogram using Torchaudio Implementation.
code: def forward(
      self, input: torch.Tensor, input_length: torch.Tensor
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      # input check
      assert (
          len(input.size()) == 2
      ), "The number of dimensions of input tensor must be 2!"
  
      with torch.no_grad():
          with torch.cuda.amp.autocast(enabled=False):
              if self.preemp:
                  # reflect padding to match lengths of in/out
                  x = input.unsqueeze(1)
                  x = F.pad(x, (1, 0), "reflect")
  
                  # apply preemphasis
                  x = F.conv1d(x, self.flipped_filter).squeeze(1)
              else:
                  x = input
  
              # apply frame feature extraction
              x = self.transform(x)
  
              if self.log:
                  x = torch.log(x + 1e-6)
              if self.normalize is not None:
                  if self.normalize == "mn":
                      x = x - torch.mean(x, dim=-1, keepdim=True)
                  else:
                      raise NotImplementedError(
                          f"got {self.normalize}, not implemented"
                      )
  
      input_length = torch.Tensor([x.size(-1)]).repeat(x.size(0))
  
      return x.permute(0, 2, 1), input_length
  
file_path: espnet/espnet2/asr/frontend/melspec_torch.py
imports: from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  import torchaudio
  from typeguard import check_argument_types
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
label_desc: Use image node_id 2 for calling the MelSpectrogramTorch obj's underlying member method code with example usage: obj.forward(input, input_length) and returns: x,  input_length