Skip to content

Commit

Permalink
two methods are conflict
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 3dd256b commit 924bacd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/tests/consistent/test_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 924bacd

Please sign in to comment.