def _get_loss(self, pert: "torch.Tensor", epsilon: float) -> "torch.Tensor":  # pylint: disable=R0201
        """
        Calculate accumulated distance of the perturbations outside the epsilon ball.

        :param pert: Perturbations in the pixel space.
        :param epsilon: The radius of the epsilon bass.
        :return: loss.
        """
        import torch

        count = torch.where(pert == 0, torch.zeros_like(pert), torch.ones_like(pert))
        pert = torch.where(torch.abs(pert) <= epsilon, torch.zeros_like(pert), pert)
        pert = torch.abs(pert)
        loss = torch.sqrt(pert) / torch.sum(count)

        return loss

        Calculate accumulated distance of the perturbations outside the epsilon ball.

        :param pert: Perturbations in the pixel space.
        :param epsilon: The radius of the epsilon bass.
        :return: loss.
        
art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py