class_docstr: STFT decoder for speech enhancement and separation
class_docstr_tok: ["STFT","decoder","for","speech","enhancement","and","separation"]
docstr: Forward.
  
  Args:
      input (ComplexTensor): spectrum [Batch, T, (C,) F]
      ilens (torch.Tensor): input lengths [Batch]
      fs (int): sampling rate in Hz
          If not None, reconfigure iSTFT window and hop lengths for a new
          sampling rate while keeping their duration fixed.
docstr_tok: ["Forward",".","Args",":","input","(","ComplexTensor",")",":","spectrum","[","Batch",",","T",",","(","C",",",")","F","]","ilens","(","torch.Tensor",")",":","input","lengths","[","Batch","]","fs","(","int",")",":","sampling","rate","in","Hz","If","not","None",",","reconfigure","iSTFT","window","and","hop","lengths","for","a","new","sampling","rate","while","keeping","their","duration","fixed","."]
code: def forward(
      self, input: ComplexTensor, ilens: torch.Tensor, fs: int = None
  ):
      """Forward.
  
      Args:
          input (ComplexTensor): spectrum [Batch, T, (C,) F]
          ilens (torch.Tensor): input lengths [Batch]
          fs (int): sampling rate in Hz
              If not None, reconfigure iSTFT window and hop lengths for a new
              sampling rate while keeping their duration fixed.
      """
      if not isinstance(input, ComplexTensor) and (
          is_torch_1_9_plus and not torch.is_complex(input)
      ):
          raise TypeError(
              "Only support complex tensors for stft decoder"
          )
      if fs is not None:
          self._reconfig_for_fs(fs)
  
      input = self.spec_back(input)
  
      bs = input.size(0)
      if input.dim() == 4:
          multi_channel = True
          # input: (Batch, T, C, F) -> (Batch * C, T, F)
          input = input.transpose(1, 2).reshape(
              -1, input.size(1), input.size(3)
          )
      else:
          multi_channel = False
  
      # for supporting half-precision training
      if input.dtype in (torch.float16, torch.bfloat16):
          wav, wav_lens = self.stft.inverse(input.float(), ilens)
          wav = wav.to(dtype=input.dtype)
      elif (
          is_torch_complex_tensor(input)
          and hasattr(torch, "complex32")
          and input.dtype == torch.complex32
      ):
          wav, wav_lens = self.stft.inverse(input.cfloat(), ilens)
          wav = wav.to(dtype=input.dtype)
      else:
          wav, wav_lens = self.stft.inverse(input, ilens)
  
      if multi_channel:
          # wav: (Batch * C, Nsamples) -> (Batch, Nsamples, C)
          wav = wav.reshape(bs, -1, wav.size(1)).transpose(1, 2)
  
      self._reset_config()
      return wav, wav_lens
  
file_path: espnet/espnet2/enh/decoder/stft_decoder.py
imports: import torch
  import torch_complex
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.decoder.abs_decoder import AbsDecoder
  from espnet2.enh.layers.complex_utils import is_torch_complex_tensor
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 2 for calling the STFTDecoder obj's underlying member method code with example usage: obj.forward(input, ilens, fs) and returns: wav,  wav_lens