From 0e035c2d4e74b59d6222035d35591d6ec17b9165 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 07:09:04 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/api_cc/src/DeepPotPT.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/api_cc/src/DeepPotPT.cc b/source/api_cc/src/DeepPotPT.cc index e71a0b0913..cb065bcc08 100644 --- a/source/api_cc/src/DeepPotPT.cc +++ b/source/api_cc/src/DeepPotPT.cc @@ -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);