From 924bacdd87b86ee0be79839bb716821d364d517c Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 8 Nov 2024 00:36:50 -0500 Subject: [PATCH] two methods are conflict Signed-off-by: Jinzhe Zeng --- source/tests/consistent/test_activation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/tests/consistent/test_activation.py b/source/tests/consistent/test_activation.py index b23cf7e066..2af545fc35 100644 --- a/source/tests/consistent/test_activation.py +++ b/source/tests/consistent/test_activation.py @@ -7,6 +7,9 @@ from deepmd.common import ( VALID_ACTIVATION, ) +from deepmd.dpmodel.common import ( + to_numpy_array, +) from deepmd.dpmodel.utils.network import get_activation_fn as get_activation_fn_dp from ..seed import ( @@ -21,8 +24,8 @@ if INSTALLED_PT: from deepmd.pt.utils.utils import ActivationFn as ActivationFn_pt + from deepmd.pt.utils.utils import to_numpy_array as torch_to_numpy from deepmd.pt.utils.utils import ( - to_numpy_array, to_torch_tensor, ) if INSTALLED_TF: @@ -59,7 +62,7 @@ def test_tf_consistent_with_ref(self): @unittest.skipUnless(INSTALLED_PT, "PyTorch is not installed") def test_pt_consistent_with_ref(self): if INSTALLED_PT: - test = to_numpy_array( + test = torch_to_numpy( ActivationFn_pt(self.activation)(to_torch_tensor(self.random_input)) ) np.testing.assert_allclose(self.ref, test, atol=1e-10)