diff --git a/source/api_cc/src/DeepPotPT.cc b/source/api_cc/src/DeepPotPT.cc index 4f17c30e25..68da1cabd2 100644 --- a/source/api_cc/src/DeepPotPT.cc +++ b/source/api_cc/src/DeepPotPT.cc @@ -89,7 +89,10 @@ void DeepPotPT::init(const std::string& model, std::unordered_map metadata = {{"type", ""}}; module = torch::jit::load(model, device, metadata); module.eval(); - const std::vector& preserved_attrs = {"forward_lower", "has_message_passing", "get_rcut", "get_ntypes", "get_dim_fparam", "get_dim_aparam", "is_aparam_nall", "get_type_map"}; + const std::vector& preserved_attrs = { + "forward_lower", "has_message_passing", "get_rcut", + "get_ntypes", "get_dim_fparam", "get_dim_aparam", + "is_aparam_nall", "get_type_map"}; module = torch::jit::freeze(module, preserved_attrs); do_message_passing = module.run_method("has_message_passing").toBool(); torch::jit::FusionStrategy strategy; diff --git a/source/api_cc/src/DeepSpinPT.cc b/source/api_cc/src/DeepSpinPT.cc index fac494772c..1add9a4068 100644 --- a/source/api_cc/src/DeepSpinPT.cc +++ b/source/api_cc/src/DeepSpinPT.cc @@ -89,7 +89,10 @@ void DeepSpinPT::init(const std::string& model, std::unordered_map metadata = {{"type", ""}}; module = torch::jit::load(model, device, metadata); module.eval(); - const std::vector& preserved_attrs = {"forward_lower", "has_message_passing", "get_rcut", "get_ntypes", "get_dim_fparam", "get_dim_aparam", "is_aparam_nall", "get_type_map"}; + const std::vector& preserved_attrs = { + "forward_lower", "has_message_passing", "get_rcut", + "get_ntypes", "get_dim_fparam", "get_dim_aparam", + "is_aparam_nall", "get_type_map"}; module = torch::jit::freeze(module, preserved_attrs); do_message_passing = module.run_method("has_message_passing").toBool(); torch::jit::FusionStrategy strategy;