code: def normalize_batch(x, seq_len, normalize_type):
      constant = 1e-5
      if normalize_type == "per_feature":
          x_mean = torch.zeros(
              (seq_len.shape[0], x.shape[1]),
              dtype=x.dtype,
              device=x.device,
          )
          x_std = torch.zeros_like(x_mean)
          for i in range(x.shape[0]):
              x_mean[i, :] = x[i, :, : seq_len[i]].mean(dim=1)
              x_std[i, :] = x[i, :, : seq_len[i]].std(dim=1)
          # make sure x_std is not zero
          x_std += constant
          return (x - x_mean.unsqueeze(2)) / x_std.unsqueeze(2)
      elif normalize_type == "all_features":
          x_mean = torch.zeros(
              seq_len.shape, dtype=x.dtype, device=x.device
          )
          x_std = torch.zeros_like(x_mean)
          for i in range(x.shape[0]):
              x_mean[i] = x[i, :, : seq_len[i].item()].mean()
              x_std[i] = x[i, :, : seq_len[i].item()].std()
          # make sure x_std is not zero
          x_std += constant
          return (x - x_mean.view(-1, 1, 1)) / x_std.view(-1, 1, 1)
      else:
          return x
  
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 2 for calling the FilterbankFeatures obj's underlying member method code with example usage: obj.normalize_batch(x, seq_len, normalize_type) and returns: unknown, unknown, x