def METHOD_NAME(self, net_output, log_probs, sample=None):
    """Get normalized probabilities (or log probs) from a net's output."""
    encoder_out = net_output["encoder_out"][0]
    if torch.is_tensor(encoder_out):
        logits = encoder_out.float()
        if log_probs:
            return F.log_softmax(logits, dim=-1)
        else:
            return F.softmax(logits, dim=-1)
    raise NotImplementedError