enable recursive function testcase

This commit is contained in:
lanzhineng 2021-09-27 10:07:14 +08:00
parent 2969688382
commit 632e38c1d6
3 changed files with 3 additions and 7 deletions

View File

@ -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

View File

@ -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.";
}
}

View File

@ -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)