code: def test_inverse(n_fft, hop_length, window, device):
      x = torch.tensor(example_y, device=device)
      stft = STFT(
          n_fft=n_fft, hop_length=hop_length, window=window, iSTFT=True
      ).to(device)
      X = stft(x.unsqueeze(0), output_format="Complex")
      x_recon = stft.inverse(X, length=x.shape[0]).squeeze()
      assert np.allclose(x.cpu(), x_recon.cpu(), rtol=1e-3, atol=1)
      x = torch.randn(4, 16000).to(device)
      X = stft(x, output_format="Complex")
      x_recon = stft.inverse(X, length=x.shape[1]).squeeze()
      assert np.allclose(x.cpu(), x_recon.cpu(), rtol=1e-5, atol=1e-3)
  
file_path: nnAudio/Installation/tests/test_stft.py
imports: import pytest
  import librosa
  import torch
  from scipy.signal import chirp, sweep_poly
  import sys
  from nnAudio.Spectrogram import *
  from parameters import *
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: test_inverse(n_fft, hop_length, window, device) without return types