class_docstr: Constructs a Wav2Vec2 feature extractor.
  
  This feature extractor inherits from [`~feature_extraction_sequence_utils.SequenceFeatureExtractor`] which contains
  most of the main methods. Users should refer to this superclass for more information regarding those methods.
  
  Args:
      feature_size (`int`, defaults to 1):
          The feature dimension of the extracted features.
      sampling_rate (`int`, defaults to 16000):
          The sampling rate at which the audio files should be digitalized expressed in Hertz per second (Hz).
      padding_value (`float`, defaults to 0.0):
          The value that is used to fill the padding values.
      do_normalize (`bool`, *optional*, defaults to `True`):
          Whether or not to zero-mean unit-variance normalize the input. Normalizing can help to significantly
          improve the performance for some models, *e.g.*,
          [wav2vec2-lv60](https://huggingface.co/models?search=lv60).
      return_attention_mask (`bool`, *optional*, defaults to `False`):
          Whether or not [`~Wav2Vec2FeatureExtractor.__call__`] should return `attention_mask`.
  
          <Tip>
  
          Wav2Vec2 models that have set `config.feat_extract_norm == "group"`, such as
          [wav2vec2-base](https://huggingface.co/facebook/wav2vec2-base-960h), have **not** been trained using
          `attention_mask`. For such models, `input_values` should simply be padded with 0 and no `attention_mask`
          should be passed.
  
          For Wav2Vec2 models that have set `config.feat_extract_norm == "layer"`, such as
          [wav2vec2-lv60](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self), `attention_mask` should be
          passed for batched inference.
  
          </Tip>
docstr: Every array in the list is normalized to have zero mean and unit variance
docstr_tok: ["Every","array","in","the","list","is","normalized","to","have","zero","mean","and","unit","variance"]
code: def zero_mean_unit_var_norm(
      input_values: List[np.ndarray],
      attention_mask: List[np.ndarray],
      padding_value: float = 0.0,
  ) -> List[np.ndarray]:
      """
      Every array in the list is normalized to have zero mean and unit variance
      """
      if attention_mask is not None:
          attention_mask = np.array(attention_mask, np.int32)
          normed_input_values = []
  
          for vector, length in zip(
              input_values, attention_mask.sum(-1)
          ):
              normed_slice = (
                  vector - vector[:length].mean()
              ) / np.sqrt(vector[:length].var() + 1e-7)
              if length < normed_slice.shape[0]:
                  normed_slice[length:] = padding_value
  
              normed_input_values.append(normed_slice)
      else:
          normed_input_values = [
              (x - x.mean()) / np.sqrt(x.var() + 1e-7)
              for x in input_values
          ]
  
      return normed_input_values
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/wav2vec2/feature_extraction_wav2vec2.py
imports: from typing import List, Optional, Union
  import numpy
  from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
  from ...feature_extraction_utils import BatchFeature
  from ...utils import PaddingStrategy, TensorType, logging
label_desc: Use image node_id 2 for calling the Wav2Vec2FeatureExtractor obj's underlying member method code with example usage: obj.zero_mean_unit_var_norm(input_values, attention_mask, padding_value) and returns: normed_input_values