code: def spec_to_mel_torch(
      spec, n_fft, num_mels, sampling_rate, fmin, fmax
  ):
      global mel_basis
      dtype_device = str(spec.dtype) + "_" + str(spec.device)
      fmax_dtype_device = str(fmax) + "_" + dtype_device
      if fmax_dtype_device not in mel_basis:
          mel = librosa_mel_fn(
              sr=sampling_rate,
              n_fft=n_fft,
              n_mels=num_mels,
              fmin=fmin,
              fmax=fmax,
          )
          mel_basis[fmax_dtype_device] = torch.from_numpy(mel).to(
              dtype=spec.dtype, device=spec.device
          )
      spec = torch.matmul(mel_basis[fmax_dtype_device], spec)
      spec = spectral_normalize_torch(spec)
      return spec
  
file_path: TTS/TTS/vc/modules/freevc/mel_processing.py
imports: import torch
  import torch.utils.data
  from librosa.filters import mel
label_desc: Use image node_id 6 for calling a global function with example usage: spec_to_mel_torch(spec, n_fft, num_mels, sampling_rate, fmin, fmax) and returns: spec