code: def test_mel_spectrogram(n_fft, win_length, device):
      x = example_y
      melspec = MelSpectrogram(
          n_fft=n_fft, win_length=win_length, hop_length=512
      ).to(device)
      X = melspec(torch.tensor(x, device=device).unsqueeze(0)).squeeze()
      X_librosa = librosa.feature.melspectrogram(
          x, n_fft=n_fft, win_length=win_length, hop_length=512
      )
      assert np.allclose(X.cpu(), X_librosa, rtol=1e-3, atol=1e-3)
  
file_path: nnAudio/Installation/tests/tests_mel.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 1 for calling a global function with example usage: test_mel_spectrogram(n_fft, win_length, device) without return types