def cross_entropy(self, new_outputs, old_outputs):
        """Calculates cross-entropy with temperature scaling"""
        # logp = torch.nn.functional.log_softmax(new_outputs / self.T, dim=1)
        # pre_p = torch.nn.functional.softmax(old_outputs / self.T, dim=1)
        # return -torch.mean(torch.sum(pre_p * logp, dim=1)) * self.T * self.T

        # The previous implementation (above), multiplied the final loss by T^2, which is not correct.
        # In addition, this is more aligned to how it's done in the original implementation.
        dis_logits_soft = torch.nn.functional.softmax(old_outputs / 2, dim=0)
        loss_distill = torch.nn.functional.cross_entropy(
            new_outputs / 2, dis_logits_soft
        )
        return loss_distill
Calculates cross-entropy with temperature scaling
avalanche/training/plugins/bic.py