code: def torch_mel_fbank(
      spectrogram,
      sample_rate,
      device="cpu",
      nfilt=64,
      lowfreq=0,
      highfreq=None,
  ):
      spectrogram = torch.tensor(spectrogram, dtype=torch.float32)
      if device == "gpu":
          spectrogram = spectrogram.cuda()
      n_fft = 2 * (spectrogram.shape[0] - 1)
      filterbanks = torch.tensor(
          librosa.filters.mel(
              sample_rate,
              n_fft,
              n_mels=nfilt,
              fmin=lowfreq,
              fmax=highfreq,
          ),
          dtype=torch.float,
      )
      if device == "gpu":
          filterbanks = filterbanks.cuda()
      mel_spectrogram = torch.matmul(
          filterbanks.to(spectrogram.dtype), spectrogram
      )
      mel_spectrogram = mel_spectrogram.cpu().numpy()
      return mel_spectrogram
  
imports: import nose_utils
  import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  import nvidia.dali.types
  from test_utils import get_files, to_array
  import numpy
  import librosa
  import torch
  import math
  import random
  import os
  from nose.tools import nottest
label_desc: Use image node_id 6 for calling a global function with example usage: torch_mel_fbank(spectrogram, sample_rate, device, nfilt, lowfreq, highfreq) and returns: mel_spectrogram