def _calculate_model_params(
        p_classifier: PyTorchClassifier,
    ) -> tuple[dict[str, dict[str, "torch.Tensor"]], "torch.Tensor"]:
        """
        Calculates a given model's different layers' parameters' shape and norm, and model parameter norm.

        :param p_classifier: model for awp protocol.
        :return: Tuple with first element a dictionary with model parameters' names as keys and a nested dictionary
        as value. The nested dictionary contains model parameters, model parameters' size, model parameters' norms.
        The second element of tuple denotes norm of all model parameters
        """
        import torch

        params_dict: dict[str, dict[str, "torch.Tensor"]] = OrderedDict()
        list_params = []
        for name, param in p_classifier.model.state_dict().items():
            if len(param.size()) <= 1:
                continue
            if "weight" in name:
                temp_param = param.reshape(-1)
                list_params.append(temp_param)
                params_dict[name] = OrderedDict()
                params_dict[name]["param"] = temp_param
                params_dict[name]["size"] = param.size()
                params_dict[name]["norm"] = temp_param.norm()

        model_all_params = torch.cat(list_params)
        model_all_params_norm = model_all_params.norm()
        return params_dict, model_all_params_norm

        Calculates a given model's different layers' parameters' shape and norm, and model parameter norm.

        :param p_classifier: model for awp protocol.
        :return: Tuple with first element a dictionary with model parameters' names as keys and a nested dictionary
        as value. The nested dictionary contains model parameters, model parameters' size, model parameters' norms.
        The second element of tuple denotes norm of all model parameters
        
art/defences/trainer/adversarial_trainer_oaat_pytorch.py