def _project(x: torch.Tensor, x_0: torch.Tensor, maxnorm: float | None = None):
            """
            Apply a projection of the current inputs with the maxnorm

            :param x: The inputs to apply a projection on (either original or adversarial)
            :param x_0: The unperterbed inputs to apply the projection on
            :param maxnorm: The maxnorm value to apply to x
            """
            if maxnorm is not None:
                eta = x - x_0
                eta = eta.renorm(p=2, dim=0, maxnorm=maxnorm)
                x = x_0 + eta
            x = torch.clamp(x, 0, 1)
            x = x.detach()
            return x

            Apply a projection of the current inputs with the maxnorm

            :param x: The inputs to apply a projection on (either original or adversarial)
            :param x_0: The unperterbed inputs to apply the projection on
            :param maxnorm: The maxnorm value to apply to x
            
art/estimators/certification/randomized_smoothing/smooth_mix/pytorch.py