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 transform(self, input_data):
      num_batches = input_data.size(0)
      num_samples = input_data.size(1)
  
      self.num_samples = num_samples
  
      # similar to librosa, reflect-pad the input
      input_data = input_data.view(num_batches, 1, num_samples)
      input_data = F.pad(
          input_data.unsqueeze(1),
          (
              int(self.filter_length / 2),
              int(self.filter_length / 2),
              0,
              0,
          ),
          mode="reflect",
      )
      input_data = input_data.squeeze(1)
  
      forward_transform = F.conv1d(
          input_data,
          Variable(self.forward_basis, requires_grad=False),
          stride=self.hop_length,
          padding=0,
      )
  
      cutoff = int((self.filter_length / 2) + 1)
      real_part = forward_transform[:, :cutoff, :]
      imag_part = forward_transform[:, cutoff:, :]
  
      magnitude = torch.sqrt(real_part**2 + imag_part**2)
      phase = torch.autograd.Variable(
          torch.atan2(imag_part.data, real_part.data)
      )
  
      return magnitude, phase
  
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 2 for calling the STFT obj's underlying member method code with example usage: obj.transform(input_data) and returns: magnitude,  phase