Skip to content

Commit

Permalink
fix(pt): set device for PT C++
Browse files Browse the repository at this point in the history
Fix deepmodeling#4171.

Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Oct 26, 2024
1 parent fa61d69 commit 5f7707a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void DeepPotPT::init(const std::string& model,
device = torch::Device(torch::kCPU);
std::cout << "load model from: " << model << " to cpu " << std::endl;
} else {
c10::cuda::set_device(gpu_id);
std::cout << "load model from: " << model << " to gpu " << gpu_id
<< std::endl;
}
Expand Down

0 comments on commit 5f7707a

Please sign in to comment.