add control test cases for ci

This commit is contained in:
chenfei 2021-07-06 21:39:14 +08:00
parent d1c67aa241
commit 8c9a1d65b3
3 changed files with 15 additions and 1 deletions

View File

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

View File

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

View File

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