diff --git a/source/api_cc/src/DeepPotPT.cc b/source/api_cc/src/DeepPotPT.cc index 69d73c18e2..4e27d9a1da 100644 --- a/source/api_cc/src/DeepPotPT.cc +++ b/source/api_cc/src/DeepPotPT.cc @@ -102,6 +102,11 @@ void DeepPotPT::compute(ENERGYVTYPE& ener, torch::from_blob(atype_64.data(), {1, natoms}, int_options).to(device); if (ago == 0) { nlist_data.copy_from_nlist(lmp_list, max_num_neighbors); + std::cout << "Vector content:" << std::endl; + for (const auto& element : nlist_data.jlist) { + std::cout << element << " "; + } + std::cout << std::endl; } at::Tensor firstneigh = torch::from_blob(nlist_data.jlist.data(), @@ -127,6 +132,7 @@ void DeepPotPT::compute(ENERGYVTYPE& ener, torch::Tensor flat_atom_energy_ = atom_energy_.toTensor().view({-1}).to(floatType); torch::Tensor cpu_atom_energy_ = flat_atom_energy_.to(torch::kCPU); + std::cout << cpu_atom_energy_ << std::endl; atom_energy.assign( cpu_atom_energy_.data_ptr(), cpu_atom_energy_.data_ptr() + cpu_atom_energy_.numel()); diff --git a/source/api_cc/tests/test_deeppot_pt.cc b/source/api_cc/tests/test_deeppot_pt.cc index 8b2185080f..cc30e606c0 100644 --- a/source/api_cc/tests/test_deeppot_pt.cc +++ b/source/api_cc/tests/test_deeppot_pt.cc @@ -279,14 +279,12 @@ TYPED_TEST(TestInferDeepPotAPt, cpu_lmp_nlist_atomic) { std::vector ilist(nloc), numneigh(nloc); std::vector firstneigh(nloc); deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]); - std::cout << nlist_data << std::endl; convert_nlist(inlist, nlist_data); double ener; std::vector force_, atom_ener_, atom_vir_, virial; std::vector force, atom_ener, atom_vir; dp.compute(ener, force_, virial, atom_ener_, atom_vir_, coord_cpy, atype_cpy, box, nall - nloc, inlist, 0); - std::cout << atom_ener_ << std::endl; _fold_back(force, force_, mapping, nloc, nall, 3); _fold_back(atom_ener, atom_ener_, mapping, nloc, nall, 1); _fold_back(atom_vir, atom_vir_, mapping, nloc, nall, 9);