diff --git a/deepmd/pt/model/model/dp_atomic_model.py b/deepmd/pt/model/model/dp_atomic_model.py index 7190723eb0..f9c47105cf 100644 --- a/deepmd/pt/model/model/dp_atomic_model.py +++ b/deepmd/pt/model/model/dp_atomic_model.py @@ -100,7 +100,7 @@ def get_rcut(self) -> float: def get_sel(self) -> List[int]: """Get the neighbor selection.""" return self.sel - + def get_nnei(self) -> List[int]: """Get the the number of selected atoms in the cut-off radius.""" return self.nnei diff --git a/source/api_cc/src/DeepPotPT.cc b/source/api_cc/src/DeepPotPT.cc index d59b5562a9..651a12eb97 100644 --- a/source/api_cc/src/DeepPotPT.cc +++ b/source/api_cc/src/DeepPotPT.cc @@ -94,9 +94,10 @@ void DeepPotPT::compute(ENERGYVTYPE& ener, at::Tensor firstneigh = torch::from_blob( nlist_data.jlist, {lmp_list.inum, max_num_neighbors}, int32_options); at::Tensor nlist = firstneigh.to(torch::kInt64).to(device); - firstneigh_tensor = - module.run_method("format_nlist", coord_wrapped_Tensor,atype_Tensor,nlist) - .toTensor(); + firstneigh_tensor = module + .run_method("format_nlist", coord_wrapped_Tensor, + atype_Tensor, nlist) + .toTensor(); } else { at::Tensor firstneigh = torch::from_blob( nlist_data.jlist, {1, lmp_list.inum, max_num_neighbors}, @@ -107,7 +108,10 @@ void DeepPotPT::compute(ENERGYVTYPE& ener, bool do_atom_virial_tensor = true; torch::Tensor mapping_tensor = torch::Tensor(nullptr); c10::Dict outputs = - module.run_method("forward_lower",coord_wrapped_Tensor,atype_Tensor,firstneigh_tensor,mapping_tensor, do_atom_virial_tensor).toGenericDict(); + module + .run_method("forward_lower", coord_wrapped_Tensor, atype_Tensor, + firstneigh_tensor, mapping_tensor, do_atom_virial_tensor) + .toGenericDict(); c10::IValue energy_ = outputs.at("energy"); c10::IValue force_ = outputs.at("extended_force"); c10::IValue virial_ = outputs.at("reduced_virial");