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 e61a509 commit 6c4a641
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 @@ -193,11 +193,9 @@ void DeepPotPT::compute(ENERGYVTYPE& ener,
const std::vector<VALUETYPE>& coord,
const std::vector<int>& atype,
const std::vector<VALUETYPE>& box) {
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 6c4a641

Please sign in to comment.