def calculate_lpips_distance(  # type: ignore
        p_classifier: PyTorchClassifier,
        input_1: "torch.Tensor",
        input_2: "torch.Tensor",
        layers: list[int | str],
    ) -> "torch.Tensor":
        """
        Return the LPIPS distance between input_1 and input_2. `layers` is a list of either layer indices (between 0 and
        `nb_layers - 1`) or layers' name. The number of layers can be determined by counting the results returned by
        calling `layer_names`.

        :param p_classifier: model for adversarial training protocol.
        :param input_1: Input for computing the activations.
        :param input_2: Input for computing the activations.
        :param layers: Layers for computing the activations.
        :return: The lpips distance, where the first dimension is the batch size corresponding to
                `input_1`.
        """

        import torch

        activations_input_1, list_layer_names = AdversarialTrainerOAATPyTorch.get_layer_activations(
            p_classifier, input_1, layers
        )
        activations_input_2, _ = AdversarialTrainerOAATPyTorch.get_layer_activations(p_classifier, input_2, layers)
        normalised_activations_1 = AdversarialTrainerOAATPyTorch.normalize_concatenate_activations(
            activations_input_1, list_layer_names
        )
        normalised_activations_2 = AdversarialTrainerOAATPyTorch.normalize_concatenate_activations(
            activations_input_2, list_layer_names
        )
        lpips_distance = torch.norm(normalised_activations_1 - normalised_activations_2, dim=1)

        return lpips_distance

        Return the LPIPS distance between input_1 and input_2. `layers` is a list of either layer indices (between 0 and
        `nb_layers - 1`) or layers' name. The number of layers can be determined by counting the results returned by
        calling `layer_names`.

        :param p_classifier: model for adversarial training protocol.
        :param input_1: Input for computing the activations.
        :param input_2: Input for computing the activations.
        :param layers: Layers for computing the activations.
        :return: The lpips distance, where the first dimension is the batch size corresponding to
                `input_1`.
        
art/defences/trainer/adversarial_trainer_oaat_pytorch.py