def __call__(
        self,
        input_in: torch.Tensor,
        target_in: torch.Tensor,
        task_in: torch.Tensor,
        output_buffer: torch.Tensor,
        target_buffer: torch.Tensor,
        pos_neg_replay: tuple,
    ) -> torch.Tensor:
        """
        Method able to compute the ER_AML loss.
        :param input_in: New inputs examples.
        :param target_in: Labels of new examples.
        :param task_in: Task identifiers of new examples.
        :param output_buffer: Predictions of samples from buffer.
        :param target_buffer: Labels of samples from buffer.
        :param pos_neg_replay: Replay data to compute positive and negative samples.
        :return: ER_AML computed loss.
        """
        pos_x, pos_y, neg_x, neg_y = self.__sample_pos_neg(
            target_in, task_in, *pos_neg_replay
        )
        loss_buffer = F.cross_entropy(output_buffer, target_buffer)
        hidden_in = self.__scale_by_norm(self.feature_extractor(input_in))
        hidden_pos_neg = self.__scale_by_norm(
            self.feature_extractor(torch.cat((pos_x, neg_x)))
        )
        loss_in = self.__sup_con_loss(
            anchor_features=hidden_in.repeat(2, 1),
            features=hidden_pos_neg,
            anchor_targets=target_in.repeat(2),
            targets=torch.cat((pos_y, neg_y)),
        )
        return loss_in + loss_buffer

        Method able to compute the ER_AML loss.
        :param input_in: New inputs examples.
        :param target_in: Labels of new examples.
        :param task_in: Task identifiers of new examples.
        :param output_buffer: Predictions of samples from buffer.
        :param target_buffer: Labels of samples from buffer.
        :param pos_neg_replay: Replay data to compute positive and negative samples.
        :return: ER_AML computed loss.
        
avalanche/training/regularization.py