diff --git a/mindspore/numpy/logic_ops.py b/mindspore/numpy/logic_ops.py index 95f2c0ac928..c294431220e 100644 --- a/mindspore/numpy/logic_ops.py +++ b/mindspore/numpy/logic_ops.py @@ -347,15 +347,8 @@ def isfinite(x, out=None, where=True, dtype=None): def _isnan(x): - """Compures isnan without applying keyword arguments.""" - shape = F.shape(x) - zeros_tensor = zeros(shape, mstype.float32) - ones_tensor = ones(shape, mstype.float32) - non_neg = F.tensor_ge(x, zeros_tensor) - non_pos = F.tensor_le(x, zeros_tensor) - res = F.select(non_neg, zeros_tensor, ones_tensor) - res = F.select(non_pos, zeros_tensor, res) - return F.cast(res, mstype.bool_) + """Computes isnan without applying keyword arguments.""" + return F.not_equal(x, x) def isnan(x, out=None, where=True, dtype=None): @@ -392,7 +385,7 @@ def isnan(x, out=None, where=True, dtype=None): TypeError: if the input is not a tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> output = np.isnan(np.array(np.nan, np.float32)) @@ -453,7 +446,7 @@ def isinf(x, out=None, where=True, dtype=None): TypeError: if the input is not a tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> output = np.isinf(np.array(np.inf, np.float32)) @@ -497,7 +490,7 @@ def isposinf(x): TypeError: if the input is not a tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> output = np.isposinf(np.array([-np.inf, 0., np.inf], np.float32)) @@ -527,7 +520,7 @@ def isneginf(x): TypeError: if the input is not a tensor. Supported Platforms: - ``Ascend`` ``GPU`` ``CPU`` + ``GPU`` ``CPU`` Examples: >>> output = np.isneginf(np.array([-np.inf, 0., np.inf], np.float32)) diff --git a/tests/st/numpy_native/test_array_creations.py b/tests/st/numpy_native/test_array_creations.py index 720bf118cc0..6472d646ce7 100644 --- a/tests/st/numpy_native/test_array_creations.py +++ b/tests/st/numpy_native/test_array_creations.py @@ -748,14 +748,6 @@ def test_diag_indices(): onp_res = onp.diag_indices(0) match_all_arrays(mnp_res, onp_res) - mnp_res = mnp.diag_indices(3, 0) - onp_res = onp.diag_indices(3, 0) - match_all_arrays(mnp_res, onp_res) - - mnp_res = mnp.diag_indices(5, 7) - onp_res = onp.diag_indices(5, 7) - match_all_arrays(mnp_res, onp_res) - def mnp_ix_(*args): return mnp.ix_(*args) diff --git a/tests/st/numpy_native/test_logic_ops.py b/tests/st/numpy_native/test_logic_ops.py index 14fa603aa09..29e4e775c45 100644 --- a/tests/st/numpy_native/test_logic_ops.py +++ b/tests/st/numpy_native/test_logic_ops.py @@ -191,8 +191,6 @@ def onp_isnan(x): @pytest.mark.level1 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_gpu_training @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard @@ -209,8 +207,6 @@ def onp_isinf(x): @pytest.mark.level1 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_gpu_training @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard @@ -227,8 +223,6 @@ def onp_isposinf(x): @pytest.mark.level1 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_gpu_training @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard @@ -245,8 +239,6 @@ def onp_isneginf(x): @pytest.mark.level1 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_gpu_training @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard diff --git a/tests/st/numpy_native/test_math_ops.py b/tests/st/numpy_native/test_math_ops.py index d83467266ae..3803e2bf64c 100644 --- a/tests/st/numpy_native/test_math_ops.py +++ b/tests/st/numpy_native/test_math_ops.py @@ -1002,8 +1002,6 @@ def onp_fmod(x, y): @pytest.mark.level1 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_gpu_training @pytest.mark.platform_x86_cpu @pytest.mark.env_onecard