code: def mel_fbank_func(
      nfilter,
      sample_rate,
      freq_low,
      freq_high,
      normalize,
      mel_formula,
      input_data,
  ):
      in_shape = input_data.shape
      axis = -2 if len(in_shape) > 1 else 0
      fftbin_size = in_shape[axis]
      nfft = 2 * (fftbin_size - 1)
      librosa_norm = "slaney" if normalize else None
      librosa_htk = mel_formula == "htk"
      mel_transform = librosa.filters.mel(
          sr=sample_rate,
          n_mels=nfilter,
          n_fft=nfft,
          fmin=freq_low,
          fmax=freq_high,
          norm=librosa_norm,
          dtype=np.float32,
          htk=librosa_htk,
      )
  
      out_shape = list(in_shape)
      out_shape[axis] = nfilter
      out_shape = tuple(out_shape)
      out = np.zeros(out_shape, dtype=np.float32)
  
      if len(in_shape) == 3:
          for i in range(in_shape[0]):
              out[i, :, :] = np.dot(mel_transform, input_data[i, :, :])
      elif len(in_shape) <= 2:
          out = np.dot(mel_transform, input_data)
      return out
  
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import numpy
  from functools import partial
  from test_utils import compare_pipelines
  from test_utils import RandomlyShapedDataIterator
  import librosa
label_desc: Use image node_id 1 for calling a global function with example usage: mel_fbank_func(nfilter, sample_rate, freq_low, freq_high, normalize, mel_formula, input_data) and returns: out