def get_normalized_probs(self, net_output, log_probs):
        """Get normalized probabilities (or log probs) from a net's output."""

        logits = self.get_logits(net_output)

        if log_probs:
            return utils.log_softmax(logits.float(), dim=-1)
        else:
            return utils.softmax(logits.float(), dim=-1)
Get normalized probabilities (or log probs) from a net's output.
understand_icl/fairseq/fairseq/models/wav2vec/wav2vec2_asr.py