From f079cd67c2b035a5637055fd8103c18800d8d897 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 16 Jul 2024 17:04:24 -0400 Subject: [PATCH 1/2] fix(cc): compile `select_map` when TensorFlow backend is not enabled `select_map` is currently within the `BUILD_TENSORFLOW` condition block, which is wrong. The C API uses it. Signed-off-by: Jinzhe Zeng --- source/api_cc/src/common.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/api_cc/src/common.cc b/source/api_cc/src/common.cc index 203e5f9db1..a4d8a6e5bc 100644 --- a/source/api_cc/src/common.cc +++ b/source/api_cc/src/common.cc @@ -996,6 +996,7 @@ template void deepmd::session_get_vector(std::vector&, Session*, const std::string, const std::string); +#endif template void deepmd::select_map(std::vector& out, const std::vector& in, @@ -1025,6 +1026,8 @@ template void deepmd::select_map_inv( const std::vector& idx_map, const int& stride); + +#ifdef BUILD_TENSORFLOW template float deepmd::session_get_scalar(Session*, const std::string, const std::string); From 8d7aa98c9eb21b0feaab7b52dc8eafcf48398a18 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:06:02 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/api_cc/src/common.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/source/api_cc/src/common.cc b/source/api_cc/src/common.cc index a4d8a6e5bc..12309df6a0 100644 --- a/source/api_cc/src/common.cc +++ b/source/api_cc/src/common.cc @@ -1026,7 +1026,6 @@ template void deepmd::select_map_inv( const std::vector& idx_map, const int& stride); - #ifdef BUILD_TENSORFLOW template float deepmd::session_get_scalar(Session*, const std::string,