Skip to content

Commit

Permalink
I don;t understand why the tests fail randomly agter I add some tests...
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 8, 2024
1 parent 19f798c commit befc0c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions source/tests/jax/jax2tf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import tensorflow as tf

# limit the number of threads
tf.config.threading.set_inter_op_parallelism_threads(1)
tf.config.threading.set_intra_op_parallelism_threads(1)
from ...common import (
DP_TEST_TF2_ONLY,
)

if DP_TEST_TF2_ONLY:
# limit the number of threads
tf.config.threading.set_inter_op_parallelism_threads(1)
tf.config.threading.set_intra_op_parallelism_threads(1)
3 changes: 2 additions & 1 deletion source/tests/jax/jax2tf/test_nlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import pytest
import tensorflow as tf
import tensorflow.experimental.numpy as tnp

from ...utils import (
DP_TEST_TF2_ONLY,
)

if DP_TEST_TF2_ONLY:
import tensorflow.experimental.numpy as tnp

from deepmd.jax.jax2tf.nlist import (
build_neighbor_list,
extend_coord_with_ghosts,
Expand Down
3 changes: 2 additions & 1 deletion source/tests/jax/jax2tf/test_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pytest
import tensorflow as tf
import tensorflow.experimental.numpy as tnp

from ...seed import (
GLOBAL_SEED,
Expand All @@ -13,6 +12,8 @@
)

if DP_TEST_TF2_ONLY:
import tensorflow.experimental.numpy as tnp

from deepmd.jax.jax2tf.region import (
inter2phys,
to_face_distance,
Expand Down

0 comments on commit befc0c7

Please sign in to comment.