diff --git a/source/api_cc/src/DeepPotPT.cc b/source/api_cc/src/DeepPotPT.cc index 68da1cabd2..4f17c30e25 100644 --- a/source/api_cc/src/DeepPotPT.cc +++ b/source/api_cc/src/DeepPotPT.cc @@ -89,10 +89,7 @@ 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 1add9a4068..fac494772c 100644 --- a/source/api_cc/src/DeepSpinPT.cc +++ b/source/api_cc/src/DeepSpinPT.cc @@ -89,10 +89,7 @@ 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;