Skip to content

Commit 3ceb9cf

Browse files
dependabot[bot]njzjzpre-commit-ci[bot]
authored
build(deps-dev): update tensorflow-cpu requirement from ~=2.18.0 to >=2.18,<2.21 (#5074)
Updates the requirements on [tensorflow-cpu](https://github.com/tensorflow/tensorflow) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tensorflow/tensorflow/releases">tensorflow-cpu's releases</a>.</em></p> <blockquote> <h2>TensorFlow 2.20.0</h2> <h1>Release 2.20.0</h1> <h2>TensorFlow</h2> <h3>Breaking Changes</h3> <ul> <li>The <code>tensorflow-io-gcs-filesystem</code> package is now optional, due its uncertain, and limited support. To install it alongside <code>tensorflow</code>, run <code>pip install &quot;tensorflow[gcs-filesystem]&quot;</code>.</li> </ul> <h3>Major Features and Improvements</h3> <ul> <li><code>tf.data</code> <ul> <li>Adds <code>autotune.min_parallelism</code> to <code>tf.data.Options</code> to enable faster input pipeline warm up.</li> </ul> </li> <li><code>tf.lite</code> <ul> <li>tf.lite will be deprecated, in favor of the new repo <a href="https://github.com/google-ai-edge/LiteRT">https://github.com/google-ai-edge/LiteRT</a>.</li> <li>The duplicated source will also be removed from the TF repo.</li> </ul> </li> </ul> <h2>Thanks to our Contributors</h2> <p>This release contains contributions from many people at Google, as well as:</p> <p>1ndig0, 372046933, abhinav, afzpatel, Akhil Goel, Alain Carlucci, Aleksei, Alen Huang, Alex, Amrinfathima-Mcw, Aravindh Balaji, Armand Picard, Aseem Athale, Ashiq Imran, Assoap, Chao, Chase Riley Roberts, Chenhao Jiang, chunhsue, chuntl, Chunyu Jin, Corentin Kerisit, Crefeda Rodrigues, dependabot[bot], Dragan Mladjenovic, Elen Kalda, Felix Thomasmathibalan, gabeweisz, Gauri Deshpande, Georg Stefan Schmid, Guozhong Zhuang, Harsha H S, Harshith_N, Hugo Mano, Ian Tayler Lessa, Jack Wolfard, James Ward, Jane Liu, Jaroslav Sevcik, JD, Jerry-Ge, Jian Li, Jinzhe Zeng, jiunkaiy, Johannes Reifferscheid, johnnkp, junweifu, Kanvi Khanna, Kasper Nielsen, Linzb-Xyz, Luke Hutton, Mahmoud Abuzaina, Mathew Odden, Michael Platings, misterBart, Mitchell Ludwig, Mmakevic-Amd, mraunak, NamanAgarwal0905, Namrata-Ibm, Neuropilot-Captain, nhatle, Nicholas Wilson, Nikhil Shinde, Olli Lupton, Patrick J. Lopresti, Pavel Emeliyanenko, Pearu Peterson, pemeliya, Peng Sun, Philipp Hack, Pratham-Mcw, RahulSudarMCW, RakshithGB, Rakshithgb-Fujitsu, RuslanSemchenko, Ruturaj Vaidya, Sachin Muradi, sandeepgupta12, SaoirseARM, Sergey Kozub, Sevin Fide Varoglu, Shanbin Ke, Shaogang Wang, Shraiysh Vaishay, Siddhartha Menon, spiao, Swatheesh Muralidharan, Tai Ly, Terry Sun, Thibaut Goetghebuer-Planchon, Thomas Dickerson, Tilak, Tj Xu, Trevor Morris, tyb0807, vfdev, Wei Wang, wokron, wondertx, Xuefei Jiang, Yaowei Zhou, Zentrik, Ziyun Cheng, Zoranjovanovic-Ns</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md">tensorflow-cpu's changelog</a>.</em></p> <blockquote> <h1>Release 2.20.0</h1> <h2>TensorFlow</h2> <h3>Breaking Changes</h3> <ul> <li>The <code>tensorflow-io-gcs-filesystem</code> package is now optional, due its uncertain, and limited support. To install it alongside <code>tensorflow</code>, run <code>pip install &quot;tensorflow[gcs-filesystem]&quot;</code>.</li> </ul> <h3>Major Features and Improvements</h3> <ul> <li><code>tf.data</code> <ul> <li>Adds <code>autotune.min_parallelism</code> to <code>tf.data.Options</code> to enable faster input pipeline warm up.</li> </ul> </li> <li><code>tf.lite</code> <ul> <li>LiteRT announced a <a href="https://developers.googleblog.com/en/litert-maximum-performance-simplified/">new release</a> at Google IO ‘25 that improves upon TFLite, particularly in terms of NPU and GPU hardware acceleration and performance for on-device ML and AI applications. The APIs are available in Kotlin and C++.</li> <li>Additionally, LiteRT code base will decouple from TensorFlow repository, and <code>tf.lite</code> will be removed in future TensorFlow Python package. More details to follow in future release notes.</li> <li>Migrate to LiteRT for continued updates; the new repo can be found at <a href="https://github.com/google-ai-edge/LiteRT">https://github.com/google-ai-edge/LiteRT</a>. For more information and NPU EAP signup, reach out to the team at: <a href="https://g.co/ai/LiteRT-NPU-EAP">g.co/ai/LiteRT-NPU-EAP</a>.</li> </ul> </li> </ul> <h2>Thanks to our Contributors</h2> <p>This release contains contributions from many people at Google, as well as:</p> <p>1ndig0, 372046933, abhinav, afzpatel, Akhil Goel, Alain Carlucci, Aleksei, Alen Huang, Alex, Amrinfathima-Mcw, Aravindh Balaji, Armand Picard, Aseem Athale, Ashiq Imran, Assoap, Chao, Chase Riley Roberts, Chenhao Jiang, chunhsue, chuntl, Chunyu Jin, Corentin Kerisit, Crefeda Rodrigues, dependabot[bot], Dragan Mladjenovic, Elen Kalda, Felix Thomasmathibalan, gabeweisz, Gauri Deshpande, Georg Stefan Schmid, Guozhong Zhuang, Harsha H S, Harshith_N, Hugo Mano, Ian Tayler Lessa, Jack Wolfard, James Ward, Jane Liu, Jaroslav Sevcik, JD, Jerry-Ge, Jian Li, Jinzhe Zeng, jiunkaiy, Johannes Reifferscheid, johnnkp, junweifu, Kanvi Khanna, Kasper Nielsen, Linzb-Xyz, Luke Hutton, Mahmoud Abuzaina, Mathew Odden, Michael Platings, misterBart, Mitchell Ludwig, Mmakevic-Amd, mraunak, NamanAgarwal0905, Namrata-Ibm, Neuropilot-Captain, nhatle, Nicholas Wilson, Nikhil Shinde, Olli Lupton, Patrick J. Lopresti, Pavel Emeliyanenko, Pearu Peterson, pemeliya, Peng Sun, Philipp Hack, Pratham-Mcw, RahulSudarMCW, RakshithGB, Rakshithgb-Fujitsu, RuslanSemchenko, Ruturaj Vaidya, Sachin Muradi, sandeepgupta12, SaoirseARM, Sergey Kozub, Sevin Fide Varoglu, Shanbin Ke, Shaogang Wang, Shraiysh Vaishay, Siddhartha Menon, spiao, Swatheesh Muralidharan, Tai Ly, Terry Sun, Thibaut Goetghebuer-Planchon, Thomas Dickerson, Tilak, Tj Xu, Trevor Morris, tyb0807, vfdev, Wei Wang, wokron, wondertx, Xuefei Jiang, Yaowei Zhou, Zentrik, Ziyun Cheng, Zoranjovanovic-Ns</p> <h1>Release 2.19.1</h1> <h3>Bug Fixes and Other Changes</h3> <ul> <li>Fix save_model.save for Serving embedding and add SparseCore Reshard.</li> </ul> <h1>Release 2.19.0</h1> <h2>TensorFlow</h2> <h3>Breaking Changes</h3> <ul> <li><code>LiteRT</code>, a.k.a. <code>tf.lite</code>: <ul> <li>C++ API: <ul> <li>The public constants <code>tflite::Interpreter:kTensorsReservedCapacity</code> and <code>tflite::Interpreter:kTensorsCapacityHeadroom</code> are now const references, rather than <code>constexpr</code> compile-time constants. (This is to enable better API compatibility for TFLite in Play services while preserving the implementation flexibility to change the values of these constants in the future.)</li> </ul> </li> <li>Python API: <ul> <li><code>tf.lite.Interpreter</code> gives deprecation warning redirecting to its new location at <code>ai_edge_litert.interpreter</code>, as the API <code>tf.lite.Interpreter</code> will be deleted in TF 2.20. See the <a href="https://ai.google.dev/edge/litert/migration">migration guide</a> for details.</li> </ul> </li> </ul> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tensorflow/tensorflow/commit/72fbba3d20f4616d7312b5e2b7f79daf6e82f2fa"><code>72fbba3</code></a> Merge pull request <a href="https://redirect.github.com/tensorflow/tensorflow/issues/98438">#98438</a> from tensorflow-jenkins/version-numbers-2.20.0-17429</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/bf5899deaf70fa45173c5c7b8dc9ace8824dc980"><code>bf5899d</code></a> Update version numbers to 2.20.0</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/a80fbfe0eb3d71986a6ba06c6275180761d549e6"><code>a80fbfe</code></a> Merge pull request <a href="https://redirect.github.com/tensorflow/tensorflow/issues/97728">#97728</a> from tensorflow/r2.20-b0b73e1d3b4</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/b2eeb62c6bc5e93f57140690d5f5dab132fd6dc7"><code>b2eeb62</code></a> Fix release wheels build.</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/2272fa9f3573d54674c9fcfd1185943b6d11ebe5"><code>2272fa9</code></a> Merge pull request <a href="https://redirect.github.com/tensorflow/tensorflow/issues/97519">#97519</a> from rtg0795/r2.20</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/2cbf40e81cdbe77245062fc1e0bd9e45af648402"><code>2cbf40e</code></a> Refresh lock files</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/89106da7a82e3415e5b12ec36238b9882bb513f5"><code>89106da</code></a> Update keras in requirements.in and setup.py.tpl</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/ea85f434bce2ab4a1334ad552de13c537a55dd29"><code>ea85f43</code></a> Merge pull request <a href="https://redirect.github.com/tensorflow/tensorflow/issues/97305">#97305</a> from rtg0795/r2.20</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/58d26a9207e4147cb8b7e70d01775a03b9f1c106"><code>58d26a9</code></a> Update BUILD files with dependencies</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/de4ccfbc3aae6914401afa3d255e90bb6dac53c0"><code>de4ccfb</code></a> Merge pull request <a href="https://redirect.github.com/tensorflow/tensorflow/issues/97302">#97302</a> from rtg0795/r2.20</li> <li>Additional commits viewable in <a href="https://github.com/tensorflow/tensorflow/compare/v2.18.0...v2.20.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 73a1aa6 commit 3ceb9cf

File tree

63 files changed

+628
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+628
-16
lines changed

.github/workflows/suppr.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
leak:libpaddle_inference
2+
# TensorFlow 2.20
3+
leak:xla::
4+
leak:mlir::
5+
leak:llvm::

.github/workflows/test_cc.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,23 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
strategy:
1919
matrix:
20-
check_memleak: [true, false]
20+
include:
21+
- check_memleak: true
22+
enable_tensorflow: true
23+
enable_pytorch: true
24+
enable_paddle: false
25+
- check_memleak: true
26+
enable_tensorflow: false
27+
enable_pytorch: false
28+
enable_paddle: true
29+
- check_memleak: false
30+
enable_tensorflow: true
31+
enable_pytorch: true
32+
enable_paddle: false
33+
- check_memleak: false
34+
enable_tensorflow: false
35+
enable_pytorch: false
36+
enable_paddle: true
2137
steps:
2238
- uses: actions/checkout@v6
2339
- uses: actions/setup-python@v6
@@ -46,31 +62,41 @@ jobs:
4662
CMAKE_GENERATOR: Ninja
4763
CXXFLAGS: ${{ matrix.check_memleak && '-fsanitize=leak' || '' }}
4864
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/workflows/suppr.txt
65+
ENABLE_TENSORFLOW: ${{ matrix.enable_tensorflow && 'TRUE' || 'FALSE' }}
66+
ENABLE_PYTORCH: ${{ matrix.enable_pytorch && 'TRUE' || 'FALSE' }}
67+
ENABLE_PADDLE: ${{ matrix.enable_paddle && 'TRUE' || 'FALSE' }}
4968
# test lammps
5069
- run: |
5170
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/*.so ${{ github.workspace }}/dp_test/lib/
5271
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
5372
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
73+
if: matrix.enable_paddle
74+
- run: |
5475
export LD_LIBRARY_PATH=${{ github.workspace }}/dp_test/lib:$LD_LIBRARY_PATH
5576
pytest --cov=deepmd source/lmp/tests
5677
env:
5778
OMP_NUM_THREADS: 1
5879
TF_INTRA_OP_PARALLELISM_THREADS: 1
5980
TF_INTER_OP_PARALLELISM_THREADS: 1
6081
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp
82+
ENABLE_TENSORFLOW: ${{ matrix.enable_tensorflow && '1' || '0' }}
83+
ENABLE_PYTORCH: ${{ matrix.enable_pytorch && '1' || '0' }}
84+
ENABLE_JAX: ${{ matrix.enable_tensorflow && '1' || '0' }}
85+
ENABLE_PADDLE: ${{ matrix.enable_paddle && '1' || '0' }}
6186
if: ${{ !matrix.check_memleak }}
6287
# test ipi
6388
- run: |
6489
export PATH=${{ github.workspace }}/dp_test/bin:$PATH
65-
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/*.so ${{ github.workspace }}/dp_test/lib/
66-
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
67-
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
6890
pytest --cov=deepmd source/ipi/tests
6991
env:
7092
OMP_NUM_THREADS: 1
7193
TF_INTRA_OP_PARALLELISM_THREADS: 1
7294
TF_INTER_OP_PARALLELISM_THREADS: 1
7395
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib
96+
ENABLE_TENSORFLOW: ${{ matrix.enable_tensorflow && '1' || '0' }}
97+
ENABLE_PYTORCH: ${{ matrix.enable_pytorch && '1' || '0' }}
98+
ENABLE_JAX: ${{ matrix.enable_tensorflow && '1' || '0' }}
99+
ENABLE_PADDLE: ${{ matrix.enable_paddle && '1' || '0' }}
74100
if: ${{ !matrix.check_memleak }}
75101
- uses: codecov/codecov-action@v5
76102
env:

.github/workflows/test_python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
- run: pytest --cov=deepmd source/tests --splits 6 --group ${{ matrix.group }} --store-durations --clean-durations --durations-path=.test_durations --splitting-algorithm least_duration
6161
env:
6262
NUM_WORKERS: 0
63+
DP_CI_IMPORT_PADDLE_BEFORE_TF: 1
6364
FLAGS_use_stride_compute_kernel: 0
6465
- name: Test TF2 eager mode
6566
run: pytest --cov=deepmd --cov-append source/tests/consistent/io/test_io.py source/jax2tf_tests

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ dev = [
162162
pin_tensorflow_cpu = [
163163
# https://github.com/tensorflow/tensorflow/issues/75279
164164
# macos x86 has been deprecated
165-
"tensorflow-cpu~=2.18.0; platform_machine=='x86_64' and platform_system == 'Linux'",
165+
"tensorflow-cpu>=2.18,<2.21; platform_machine=='x86_64' and platform_system == 'Linux'",
166166
"tensorflow~=2.18.0; (platform_machine!='x86_64' or platform_system != 'Linux') and (platform_machine!='x86_64' or platform_system != 'Darwin')",
167167
"tensorflow; platform_machine=='x86_64' and platform_system == 'Darwin'",
168168
]

source/api_c/tests/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ target_link_libraries(runUnitTests_c PRIVATE GTest::gtest_main ${LIB_DEEPMD_C}
1111
coverage_config)
1212
target_link_libraries(runUnitTests_c PRIVATE ${LIB_DEEPMD} ${LIB_DEEPMD_CC})
1313

14+
if(ENABLE_TENSORFLOW)
15+
target_compile_definitions(runUnitTests_c PRIVATE BUILD_TENSORFLOW)
16+
endif()
17+
if(ENABLE_PYTORCH)
18+
target_compile_definitions(runUnitTests_c PRIVATE BUILD_PYTORCH)
19+
endif()
20+
if(ENABLE_JAX)
21+
target_compile_definitions(runUnitTests_c PRIVATE BUILD_JAX)
22+
endif()
23+
if(ENABLE_PADDLE)
24+
target_compile_definitions(runUnitTests_c PRIVATE BUILD_PADDLE)
25+
endif()
26+
1427
if(UNIX AND NOT APPLE)
1528
find_library(RT_LIBRARY rt)
1629
if(RT_LIBRARY)

source/api_c/tests/test_deepdipole_hpp.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class TestInferDeepDipole : public ::testing::Test {
2626
deepmd::hpp::DeepTensor dp;
2727

2828
void SetUp() override {
29+
#ifndef BUILD_TENSORFLOW
30+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
31+
#endif
2932
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/deepdipole.pbtxt",
3033
"deepdipole.pb");
3134

@@ -221,6 +224,9 @@ class TestInferDeepDipoleNew : public ::testing::Test {
221224
deepmd::hpp::DeepTensor dp;
222225

223226
void SetUp() override {
227+
#ifndef BUILD_TENSORFLOW
228+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
229+
#endif
224230
std::string file_name = "../../tests/infer/deepdipole_new.pbtxt";
225231
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/deepdipole_new.pbtxt",
226232
"deepdipole_new.pb");
@@ -434,6 +440,9 @@ class TestInferDeepDipoleFake : public ::testing::Test {
434440
deepmd::hpp::DeepTensor dp;
435441

436442
void SetUp() override {
443+
#ifndef BUILD_TENSORFLOW
444+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
445+
#endif
437446
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/deepdipole_fake.pbtxt",
438447
"deepdipole_fake.pb");
439448

source/api_c/tests/test_deeppolar_hpp.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class TestInferDeepPolar : public ::testing::Test {
3232
deepmd::hpp::DeepTensor dp;
3333

3434
void SetUp() override {
35+
#ifndef BUILD_TENSORFLOW
36+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
37+
#endif
3538
std::string file_name = "../../tests/infer/deeppolar.pbtxt";
3639
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/deeppolar.pbtxt",
3740
"deeppolar.pb");
@@ -453,6 +456,9 @@ class TestInferDeepPolarNew : public ::testing::Test {
453456
deepmd::hpp::DeepTensor dp;
454457

455458
void SetUp() override {
459+
#ifndef BUILD_TENSORFLOW
460+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
461+
#endif
456462
std::string file_name = "../../tests/infer/deeppolar_new.pbtxt";
457463
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/deeppolar_new.pbtxt",
458464
"deeppolar_new.pb");

source/api_c/tests/test_deeppot_a.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ class TestInferDeepPotA : public ::testing::Test {
6161
double expected_tot_e;
6262
std::vector<double> expected_tot_v;
6363

64-
DP_DeepPot* dp;
64+
DP_DeepPot* dp = nullptr;
6565

6666
void SetUp() override {
67+
#ifndef BUILD_TENSORFLOW
68+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
69+
#endif
6770
const char* file_name = "../../tests/infer/deeppot.pbtxt";
6871
const char* model_file = "deeppot.pb";
6972
DP_ConvertPbtxtToPb(file_name, model_file);
@@ -242,9 +245,12 @@ class TestInferDeepPotANoPBC : public ::testing::Test {
242245
double expected_tot_e;
243246
std::vector<double> expected_tot_v;
244247

245-
DP_DeepPot* dp;
248+
DP_DeepPot* dp = nullptr;
246249

247250
void SetUp() override {
251+
#ifndef BUILD_TENSORFLOW
252+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
253+
#endif
248254
const char* file_name = "../../tests/infer/deeppot.pbtxt";
249255
const char* model_file = "deeppot.pb";
250256
DP_ConvertPbtxtToPb(file_name, model_file);

source/api_c/tests/test_deeppot_a_fparam_aparam.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class TestInferDeepPotAFParamAParam : public ::testing::Test {
7272
deepmd::hpp::DeepPot dp;
7373

7474
void SetUp() override {
75+
#ifndef BUILD_TENSORFLOW
76+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
77+
#endif
7578
std::string file_name = "../../tests/infer/fparam_aparam.pbtxt";
7679
deepmd::hpp::convert_pbtxt_to_pb(file_name, "fparam_aparam.pb");
7780

@@ -394,6 +397,9 @@ class TestInferAParamNAll : public ::testing::Test {
394397
deepmd::hpp::DeepPot dp;
395398

396399
void SetUp() override {
400+
#ifndef BUILD_TENSORFLOW
401+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
402+
#endif
397403
std::string file_name = "../../tests/infer/pairwise_dprc.pbtxt";
398404
deepmd::hpp::convert_pbtxt_to_pb(file_name, "pairwise_dprc.pb");
399405
dp.init("pairwise_dprc.pb");

source/api_c/tests/test_deeppot_a_fparam_aparam_nframes.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ class TestInferDeepPotAFparamAparamNFrames : public ::testing::Test {
116116
deepmd::hpp::DeepPot dp;
117117

118118
void SetUp() override {
119+
#ifndef BUILD_TENSORFLOW
120+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
121+
#endif
119122
std::string file_name = "../../tests/infer/fparam_aparam.pbtxt";
120123
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/fparam_aparam.pbtxt",
121124
"fparam_aparam.pb");
@@ -757,6 +760,9 @@ class TestInferDeepPotAFparamAparamNFramesSingleParam : public ::testing::Test {
757760
deepmd::hpp::DeepPot dp;
758761

759762
void SetUp() override {
763+
#ifndef BUILD_TENSORFLOW
764+
GTEST_SKIP() << "Skip because TensorFlow support is not enabled.";
765+
#endif
760766
std::string file_name = "../../tests/infer/fparam_aparam.pbtxt";
761767
deepmd::hpp::convert_pbtxt_to_pb("../../tests/infer/fparam_aparam.pbtxt",
762768
"fparam_aparam.pb");

0 commit comments

Comments
 (0)