code: def test_vqt(device):
      for gamma in [0, 1, 2, 5, 10]:
          # librosa vqt
          V1 = np.abs(librosa.vqt(y, sr=sr, gamma=gamma))
  
          # nnAudio vqt
          spec = VQT(sr=sr, gamma=gamma, verbose=False).to(device)
          V2 = spec(
              torch.tensor(y).unsqueeze(0).to(device),
              output_format="Magnitude",
              normalization_type="librosa",
          )
          V2 = V2.cpu().numpy().squeeze()
  
          # NOTE: there will still be some diff between librosa and nnAudio vqt values (same as cqt)
          # mainly due to the lengths of both - librosa uses float but nnAudio uses int
          # this test aims to keep the diff range within a baseline threshold
          vqt_diff = np.abs(V1 - V2)
  
          assert np.allclose(V1, V2, 1e-3, 0.8)
  
file_path: nnAudio/Installation/tests/test_vqt.py
imports: import pytest
  import librosa
  import torch
  import sys
  import os
  from nnAudio.features import CQT2010v2, VQT
  import numpy
  from parameters import *
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: test_vqt(device) without return types