From 632e38c1d657801766e6fab7adc4bee518aa087c Mon Sep 17 00:00:00 2001 From: lanzhineng Date: Mon, 27 Sep 2021 10:07:14 +0800 Subject: [PATCH] enable recursive function testcase --- .../pipeline/jit/static_analysis/async_eval_result.cc | 1 - .../ccsrc/pipeline/jit/static_analysis/async_eval_result.h | 2 +- tests/st/control/test_recrusive_fun.py | 7 ++----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.cc b/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.cc index ec5177a6fda..bb52afb21d5 100644 --- a/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.cc +++ b/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.cc @@ -120,7 +120,6 @@ void AnalysisSchedule::Add2Schedule(const AsyncInferTaskPtr &async_infer_task_pt } bool AnalysisSchedule::SetNextReady() { if (scheduleList_.empty()) { - MS_LOG(DEBUG) << "The schedule list is empty. "; return false; } // Check if enter endless loop diff --git a/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.h b/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.h index e3f5f9a7c39..6c08c61f174 100644 --- a/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.h +++ b/mindspore/ccsrc/pipeline/jit/static_analysis/async_eval_result.h @@ -326,7 +326,7 @@ class AsyncInferTask { if (ready_ & 4) { ready_ = ready_ & 3; // Set the third bit = 0 , Only trigger once. MS_LOG(EXCEPTION) << "There isn't any branch that can be evaluated. \n" - << "Please check the code if it's has the infinite recursion or loop.\n" + << "Please check the code if it has the infinite recursion or loop.\n" << "For more details, please refer to the FAQ at https://www.mindspore.cn."; } } diff --git a/tests/st/control/test_recrusive_fun.py b/tests/st/control/test_recrusive_fun.py index a69672f0b52..855278ad320 100644 --- a/tests/st/control/test_recrusive_fun.py +++ b/tests/st/control/test_recrusive_fun.py @@ -15,7 +15,6 @@ import mindspore.context as context from mindspore import Tensor, ms_function from mindspore.common import dtype as mstype -import pytest ZERO = Tensor([0], mstype.int32) ONE = Tensor([1], mstype.int32) @@ -80,7 +79,7 @@ def test_recrusive_endless(): try: f_recrusive_endless(x) except RuntimeError as e: - assert 'endless loop' in str(e) + assert 'loop' in str(e) def test_endless(): @@ -89,7 +88,7 @@ def test_endless(): try: f(x) except RuntimeError as e: - assert 'endless loop' in str(e) + assert 'loop' in str(e) @ms_function @@ -99,7 +98,6 @@ def f_ok(x): return ONE -@pytest.mark.skip(reason="backend is not supported yet") def test_f_ok(): context.set_context(mode=context.GRAPH_MODE) x = Tensor([3], mstype.int32) @@ -108,7 +106,6 @@ def test_f_ok(): assert ret == expect -@pytest.mark.skip(reason="backend is not supported yet") def test_recrusive_fun(): context.set_context(mode=context.GRAPH_MODE) x = Tensor([5], mstype.int32)