提交 d919aaeb 编写于 作者: M Megvii Engine Team

test(imperative): reopen special interpolate test and sync when test rng

GitOrigin-RevId: e3d03b4d1d981ebf7afc8be6fe79fb5928f81aac
上级 ca2deebc
......@@ -507,7 +507,7 @@ def test_interpolate_fastpath():
[(1, 1, 10, 10), (5, 5)],
[(1, 3, 10, 10), (20, 20)],
[(10, 1, 10, 10), (1, 1)],
# [(10, 10, 1, 1), (10, 10)], # FIXME, it causes random CI failure
[(10, 10, 1, 1), (10, 10)],
]
for inp_shape, target_shape in test_cases:
x = tensor(np.random.randn(*inp_shape), dtype=np.float32)
......
......@@ -39,6 +39,8 @@ from megengine.random import uniform
get_device_count("xpu") <= 2, reason="xpu counts need > 2",
)
def test_gaussian_op():
# FIXME: remove this sync
mge.core.set_option("async_level", 0)
set_global_seed(1024)
shape = (
8,
......@@ -210,12 +212,9 @@ def test_permutation_op():
assert str(output.device) == str(cn)
assert output.dtype == dtype
# FIXME: remove this sync
mge.core.set_option("async_level", 0)
test_permutation_op_dtype(np.float32)
test_permutation_op_dtype(np.int32)
test_permutation_op_dtype(np.int16)
mge.core.set_option("async_level", 2)
@pytest.mark.skipif(
......@@ -517,3 +516,4 @@ def test_rng_empty_tensor(is_symbolic):
np.testing.assert_equal(out.numpy().shape, (0,))
if is_symbolic is None:
break
mge.core.set_option("async_level", 2)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册