Skip to content

Commit

Permalink
fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Jan 26, 2024
1 parent cedcdc7 commit d157a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/api_cc/src/DeepPot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ void DeepPot::init(const std::string& model,
<< std::endl;
return;
}
DPBackend backend;
if (model.length() >= 4 && model.substr(model.length() - 4) == ".pth") {
DPBackend backend = deepmd::DPBackend::PyTorch;
backend = deepmd::DPBackend::PyTorch;
} else if (model.length() >= 3 && model.substr(model.length() - 3) == ".pb") {
DPBackend backend = deepmd::DPBackend::TensorFlow;
backend = deepmd::DPBackend::TensorFlow;
else {
throw deepmd::deepmd_exception("Unsupported model file format");
}
Expand Down
2 changes: 2 additions & 0 deletions source/api_cc/src/commonPT.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifdef BUILD_PYTORCH
#include "commonPT.h"
using namespace deepmd;
void NeighborListDataPT::copy_from_nlist(const InputNlist& inlist,
Expand All @@ -22,3 +23,4 @@ void NeighborListDataPT::copy_from_nlist(const InputNlist& inlist,
jnum * sizeof(int));
}
}
#endif

0 comments on commit d157a4f

Please sign in to comment.