docstr: Arguments
      features - [BxTxD] Acoustic feature with shape
      padding_mask - [BxT]     Padding Mask
code: def forward(self, last_layer_feats, padding_mask, **kwargs):
      """
      Arguments
          features - [BxTxD] Acoustic feature with shape
          padding_mask - [BxT]     Padding Mask
      """
      feat_mask = (~padding_mask).to(
          last_layer_feats.dtype
      )  # T,B -> B,T
      feat = self.linear(last_layer_feats)  # B,T,D
      feat = fn_mean(feat, feat_mask)  # B,D
      feat = self.activation_fn(feat)
      # normalize feat
      feat_norm = F.normalize(feat, p=2, dim=-1)  # B,D
      weight_norm = F.normalize(
          self.projection.weight.t(), p=2, dim=-1
      )  # D,K
      cos_fw = feat_norm @ weight_norm
      return cos_fw
  
imports: import contextlib
  import logging
  from argparse import Namespace
  from dataclasses import dataclass, field
  from typing import Any, Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from omegaconf import II, MISSING, open_dict
  from fairseq import checkpoint_utils, tasks, utils
  from fairseq.dataclass import ChoiceEnum, FairseqDataclass
  from fairseq.dataclass.utils import convert_namespace_to_omegaconf
  from fairseq.models import BaseFairseqModel, FairseqEncoder, register_model
  from fairseq.models.wav2vec.wav2vec2 import MASKING_DISTRIBUTION_CHOICES, Wav2Vec2Config
  from fairseq.models.wav2vec.wav2vec2_asr import Embedding, Linear, Wav2VecEncoder, Wav2Vec2AsrConfig
  from fairseq.tasks import FairseqTask
label_desc: Use image node_id 2 for calling the MeanPoolingFastAMSoftmax obj's underlying member method code with example usage: obj.forward(last_layer_feats, padding_mask) and returns: cos_fw