code: def test_stft_magnitude(device):
      x = example_y
      stft = STFT(n_fft=2048, hop_length=512).to(device)
      X = stft(
          torch.tensor(x, device=device).unsqueeze(0),
          output_format="Magnitude",
      ).squeeze()
      X_librosa, _ = librosa.core.magphase(
          librosa.stft(x, n_fft=2048, hop_length=512)
      )
      assert np.allclose(X.cpu(), X_librosa, rtol=1e-1, atol=1e-1)
  
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 5 for calling a global function with example usage: test_stft_magnitude(device) without return types