Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 27, 2024
1 parent e1383a1 commit 0e035c2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ void DeepPotPT::init(const std::string& model,
std::cout << "load model from: " << model << " to gpu " << gpu_rank
<< std::endl;
}
int gpu_num = -1;
int gpu_num = -1;
DPGetDeviceCount(gpu_num);
if(gpu_id > gpu_num)
{
if (gpu_id > gpu_num) {
throw deepmd::deepmd_exception(
"current rank" + gpu_id +
"is larger than the number of gpu" + gpu_num);
"current rank" + gpu_id + "is larger than the number of gpu" + gpu_num);
}
module = torch::jit::load(model, device);

Expand Down

0 comments on commit 0e035c2

Please sign in to comment.