class_docstr: Computes the Inverse Short-Term Fourier Transform (ISTFT)
  
  This class computes the Inverse Short-Term Fourier Transform of
  an audio signal. It supports multi-channel audio inputs
  (batch, time_step, n_fft, 2, n_channels [optional]).
  
  Arguments
  ---------
  sample_rate : int
      Sample rate of the input audio signal (e.g. 16000).
  win_length : float
      Length (in ms) of the sliding window used when computing the STFT.
  hop_length : float
      Length (in ms) of the hope of the sliding window used when computing
      the STFT.
  window_fn : function
      A function that takes an integer (number of samples) and outputs a
      tensor to be used as a window for ifft.
  normalized_stft : bool
      If True, the function assumes that it's working with the normalized
      STFT results. (default is False)
  center : bool
      If True (default), the function assumes that the STFT result was padded
      on both sides.
  onesided : True
      If True (default), the function assumes that there are n_fft/2 values
      for each time frame of the STFT.
  epsilon : float
      A small value to avoid division by 0 when normalizing by the sum of the
      squared window. Playing with it can fix some abnormalities at the
      beginning and at the end of the reconstructed signal. The default value
      of epsilon is 1e-12.
  
  Example
  -------
  >>> import torch
  >>> compute_STFT = STFT(
  ...     sample_rate=16000, win_length=25, hop_length=10, n_fft=400
  ... )
  >>> compute_ISTFT = ISTFT(
  ...     sample_rate=16000, win_length=25, hop_length=10
  ... )
  >>> inputs = torch.randn([10, 16000])
  >>> outputs = compute_ISTFT(compute_STFT(inputs))
  >>> outputs.shape
  torch.Size([10, 16000])
class_docstr_tok: ["Computes","the","Inverse","Short-Term","Fourier","Transform","(","ISTFT",")","This","class","computes","the","Inverse","Short-Term","Fourier","Transform","of","an","audio","signal",".","It","supports","multi-channel","audio","inputs","(","batch",",","time_step",",","n_fft",",","2",",","n_channels","[","optional","]",")",".","Arguments","--","--","--","--","-","sample_rate",":","int","Sample","rate","of","the","input","audio","signal","(","e.g",".","16000",")",".","win_length",":","float","Length","(","in","ms",")","of","the","sliding","window","used","when","computing","the","STFT",".","hop_length",":","float","Length","(","in","ms",")","of","the","hope","of","the","sliding","window","used","when","computing","the","STFT",".","window_fn",":","function","A","function","that","takes","an","integer","(","number","of","samples",")","and","outputs","a","tensor","to","be","used","as","a","window","for","ifft",".","normalized_stft",":","bool","If","True",",","the","function","assumes","that","it","'s","working","with","the","normalized","STFT","results",".","(","default","is","False",")","center",":","bool","If","True","(","default",")",",","the","function","assumes","that","the","STFT","result","was","padded","on","both","sides",".","onesided",":","True","If","True","(","default",")",",","the","function","assumes","that","there","are","n_fft\/2","values","for","each","time","frame","of","the","STFT",".","epsilon",":","float","A","small","value","to","avoid","division","by","0","when","normalizing","by","the","sum","of","the","squared","window",".","Playing","with","it","can","fix","some","abnormalities","at","the","beginning","and","at","the","end","of","the","reconstructed","signal",".","The","default","value","of","epsilon","is","1e-12",".","Example","--","--","--","-",">",">",">","import","torch",">",">",">","compute_STFT","=","STFT","(","...","sample_rate=16000",",","win_length=25",",","hop_length=10",",","n_fft=400","...",")",">",">",">","compute_ISTFT","=","ISTFT","(","...","sample_rate=16000",",","win_length=25",",","hop_length=10","...",")",">",">",">","inputs","=","torch.randn","(","[","10",",","16000","]",")",">",">",">","outputs","=","compute_ISTFT","(","compute_STFT","(","inputs",")",")",">",">",">","outputs.shape","torch.Size","(","[","10",",","16000","]",")"]
docstr: Returns the ISTFT generated from the input signal.
  
  Arguments
  ---------
  x : tensor
      A batch of audio signals in the frequency domain to transform.
  sig_length : int
      The length of the output signal in number of samples. If not
      specified will be equal to: (time_step - 1) * hop_length + n_fft
docstr_tok: ["Returns","the","ISTFT","generated","from","the","input","signal",".","Arguments","--","--","--","--","-","x",":","tensor","A","batch","of","audio","signals","in","the","frequency","domain","to","transform",".","sig_length",":","int","The","length","of","the","output","signal","in","number","of","samples",".","If","not","specified","will","be","equal","to",":","(","time_step","-","1",")","*","hop_length","+","n_fft"]
code: def forward(self, x, sig_length=None):
      """Returns the ISTFT generated from the input signal.
  
      Arguments
      ---------
      x : tensor
          A batch of audio signals in the frequency domain to transform.
      sig_length : int
          The length of the output signal in number of samples. If not
          specified will be equal to: (time_step - 1) * hop_length + n_fft
      """
  
      or_shape = x.shape
  
      # Infer n_fft if not provided
      if self.n_fft is None and self.onesided:
          n_fft = (x.shape[2] - 1) * 2
      elif self.n_fft is None and not self.onesided:
          n_fft = x.shape[2]
      else:
          n_fft = self.n_fft
  
      # Changing the format for (batch, time_step, n_fft, 2, n_channels)
      if len(or_shape) == 5:
          x = x.permute(0, 4, 2, 1, 3)
  
          # Lumping batch and channel dimension, because torch.istft
          # doesn't support batching.
          x = x.reshape(-1, x.shape[2], x.shape[3], x.shape[4])
      elif len(or_shape) == 4:
          x = x.permute(0, 2, 1, 3)
  
      # isft ask complex input
      x = torch.complex(x[..., 0], x[..., 1])
  
      istft = torch.istft(
          input=x,
          n_fft=n_fft,
          hop_length=self.hop_length,
          win_length=self.win_length,
          window=self.window.to(x.device),
          center=self.center,
          onesided=self.onesided,
          length=sig_length,
      )
  
      # Convert back to (time, time_step, n_channels)
      if len(or_shape) == 5:
          istft = istft.reshape(or_shape[0], or_shape[4], -1)
          istft = istft.transpose(1, 2)
  
      return istft
  
imports: import math
  import torch
  import logging
  from speechbrain.utils.checkpoints import mark_as_saver, mark_as_loader, mark_as_transfer, register_checkpoint_hooks
  from speechbrain.dataio.dataio import length_to_mask
label_desc: Use image node_id 2 for calling the ISTFT obj's underlying member method code with example usage: obj.forward(x, sig_length) and returns: istft