Skip to content

Commit

Permalink
fix bug: device constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
CaRoLZhangxy committed Feb 3, 2024
1 parent 7bb1b1c commit e61a509
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ void DeepPotPT::compute(ENERGYVTYPE& ener,
const std::vector<VALUETYPE>& box,
const InputNlist& lmp_list,
const int& ago) {
torch::Device device;
torch::Device device(torch::kCUDA, gpu_id);
if(cpu_enabled)
device = torch::Device(torch::kCPU);
else
device = torch::Device(torch::kCUDA, gpu_id);
std::vector<VALUETYPE> coord_wrapped = coord;
int natoms = atype.size();
auto options = torch::TensorOptions().dtype(torch::kFloat64);
Expand Down

0 comments on commit e61a509

Please sign in to comment.