    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
Arguments
features - [BxTxD] Acoustic feature with shape
padding_mask - [BxT]     Padding Mask
fairseq/models/wav2vec/wav2vec2_classification.py