class_docstr: adapted from Prem Seetharaman's https://github.com/pseeth/pytorch-stft
class_docstr_tok: ["adapted","from","Prem","Seetharaman","'s","https",":","\/\/github.com\/pseeth\/pytorch-stft"]
code: def inverse(self, magnitude, phase):
      recombine_magnitude_phase = torch.cat(
          [magnitude * torch.cos(phase), magnitude * torch.sin(phase)],
          dim=1,
      )
  
      inverse_transform = F.conv_transpose1d(
          recombine_magnitude_phase,
          Variable(self.inverse_basis, requires_grad=False),
          stride=self.hop_length,
          padding=0,
      )
  
      if self.window is not None:
          window_sum = window_sumsquare(
              self.window,
              magnitude.size(-1),
              hop_length=self.hop_length,
              win_length=self.win_length,
              n_fft=self.filter_length,
              dtype=np.float32,
          )
          # remove modulation effects
          approx_nonzero_indices = torch.from_numpy(
              np.where(window_sum > tiny(window_sum))[0]
          )
          window_sum = torch.autograd.Variable(
              torch.from_numpy(window_sum), requires_grad=False
          )
          window_sum = (
              window_sum.cuda() if magnitude.is_cuda else window_sum
          )
          inverse_transform[:, :, approx_nonzero_indices] /= window_sum[
              approx_nonzero_indices
          ]
  
          # scale by hop ratio
          inverse_transform *= (
              float(self.filter_length) / self.hop_length
          )
  
      inverse_transform = inverse_transform[
          :, :, int(self.filter_length / 2) :
      ]
      inverse_transform = inverse_transform[
          :, :, : -int(self.filter_length / 2) :
      ]
  
      return inverse_transform
  
file_path: textlesslib/textless/vocoders/tacotron2/stft.py
imports: import torch
  import numpy
  import torch.nn.functional
  from torch.autograd import Variable
  from scipy.signal import get_window
  from librosa.util import pad_center, tiny
  from .audio_processing import window_sumsquare
label_desc: Use image node_id 3 for calling the STFT obj's underlying member method code with example usage: obj.inverse(magnitude, phase) and returns: inverse_transform