Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
CaRoLZhangxy committed Feb 27, 2024
1 parent 5da17cb commit e4b3265
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,12 @@ 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::endl;
}
}
at::Tensor firstneigh =
torch::from_blob(nlist_data.jlist.data(),
{1, lmp_list.inum, max_num_neighbors}, int32_options);
firstneigh_tensor = firstneigh.to(torch::kInt64).to(device);
std::cout << firstneigh_tensor <<std::endl;
bool do_atom_virial_tensor = true;
c10::optional<torch::Tensor> optional_tensor;
c10::Dict<c10::IValue, c10::IValue> outputs =
Expand All @@ -135,6 +132,7 @@ void DeepPotPT::compute(ENERGYVTYPE& ener,
atom_energy.assign(
cpu_atom_energy_.data_ptr<VALUETYPE>(),
cpu_atom_energy_.data_ptr<VALUETYPE>() + cpu_atom_energy_.numel());
std::cout << atom_energy << std::endl;
torch::Tensor flat_force_ = force_.toTensor().view({-1}).to(floatType);
torch::Tensor cpu_force_ = flat_force_.to(torch::kCPU);
force.assign(cpu_force_.data_ptr<VALUETYPE>(),
Expand Down

0 comments on commit e4b3265

Please sign in to comment.