code: def _remove_aux_axes(state_dict, axes):
      # Remove the seemingly unnecessary axis
      # For ASR task, the pretrained weights originated from fairseq has unrelated dimensions at index 1, 2, 3
      # It's originated from the Dictionary implementation of fairseq, which was intended for NLP tasks,
      # but not used during the ASR training.
      # https://github.com/pytorch/fairseq/blob/c5ff181125c7e6126b49a85e5ebdd5f5b6a07914/fairseq/data/dictionary.py#L21-L37
      # https://github.com/pytorch/fairseq/blob/c5ff181125c7e6126b49a85e5ebdd5f5b6a07914/fairseq/criterions/ctc.py#L126-L129
      #
      # Also, some pretrained weights originated from voxpopuli has an extra dimensions that almost never used and
      # that resembles mistake.
      # The label `1` shows up in the training dataset of German (1 out of 16M),
      # English (1 / 28M), Spanish (1 / 9.4M), Romanian (1 / 4.7M) and Polish (6 / 5.8M)
      for key in ["aux.weight", "aux.bias"]:
          mat = state_dict[key]
          state_dict[key] = torch.stack(
              [mat[i] for i in range(mat.size(0)) if i not in axes]
          )
  
imports: from typing import List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torchaudio._internal import load_state_dict_from_url
  from torchaudio.models import wav2vec2_model, Wav2Vec2Model, wavlm_model
label_desc: Use image node_id 3 for calling a global function with example usage: _remove_aux_axes(state_dict, axes) without return types