From 8c9a1d65b30f5e897ef3cba4bb1f9a1fb6adbfc2 Mon Sep 17 00:00:00 2001 From: chenfei Date: Tue, 6 Jul 2021 21:39:14 +0800 Subject: [PATCH] add control test cases for ci --- tests/st/control/inner/test_011_if_in_while.py | 5 +++++ tests/st/control/inner/test_011_if_in_while_break.py | 5 +++++ tests/st/control/test_fun_fun.py | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/st/control/inner/test_011_if_in_while.py b/tests/st/control/inner/test_011_if_in_while.py index 1c9d965fcc1..561a0a97b8a 100644 --- a/tests/st/control/inner/test_011_if_in_while.py +++ b/tests/st/control/inner/test_011_if_in_while.py @@ -13,6 +13,7 @@ # limitations under the License. # ============================================================================ import numpy as np +import pytest from mindspore.common import dtype as mstype from mindspore import nn from mindspore import Tensor @@ -70,6 +71,10 @@ def test_forward(): assert graph_mode_out == pynative_mode_out +@pytest.mark.level0 +@pytest.mark.platform_arm_ascend_training +@pytest.mark.platform_x86_ascend_training +@pytest.mark.env_onecard def test_backward(): # Graph Mode context.set_context(mode=context.GRAPH_MODE) diff --git a/tests/st/control/inner/test_011_if_in_while_break.py b/tests/st/control/inner/test_011_if_in_while_break.py index 587497c6250..0ce06bd5ba2 100644 --- a/tests/st/control/inner/test_011_if_in_while_break.py +++ b/tests/st/control/inner/test_011_if_in_while_break.py @@ -13,6 +13,7 @@ # limitations under the License. # ============================================================================ import numpy as np +import pytest from mindspore.common import dtype as mstype from mindspore import nn from mindspore import Tensor @@ -87,6 +88,10 @@ def test_forward(): # Problem: Exceed function call depth limit 1000. +@pytest.mark.level0 +@pytest.mark.platform_arm_ascend_training +@pytest.mark.platform_x86_ascend_training +@pytest.mark.env_onecard def test_backward(): x = Tensor(np.array(1), mstype.int32) y = Tensor(np.array(3), mstype.int32) diff --git a/tests/st/control/test_fun_fun.py b/tests/st/control/test_fun_fun.py index 59af698c110..c297ac2bfdc 100644 --- a/tests/st/control/test_fun_fun.py +++ b/tests/st/control/test_fun_fun.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ +import pytest import mindspore.context as context from mindspore import Tensor, ms_function from mindspore.common import dtype as mstype @@ -33,7 +34,10 @@ def hof(x): ret = g(x)(x) return ret - +@pytest.mark.level0 +@pytest.mark.platform_arm_ascend_training +@pytest.mark.platform_x86_ascend_training +@pytest.mark.env_onecard def test_fun_fun(): context.set_context(mode=context.GRAPH_MODE) x = Tensor([10], mstype.int32)