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

refactor(mge): loose the error bound of fastrun

GitOrigin-RevId: 9bf9b9d4ca2d66c93438b00c893f7aee4f4c3a8f
上级 1f043696
......@@ -105,17 +105,25 @@ def test_matinv():
check_pygraph_dump(fwd, [data], [result])
def test_matmul():
@pytest.mark.parametrize(
"execution_strategy", ["HEURISTIC_REPRODUCIBLE", "PROFILE_REPRODUCIBLE"]
)
def test_matmul(execution_strategy):
@trace(symbolic=True, capture_as_const=True)
def fwd(data1, data2):
return F.matmul(data1, data2)
old = get_execution_strategy()
set_execution_strategy("HEURISTIC_REPRODUCIBLE")
set_execution_strategy(execution_strategy)
max_err = None
if execution_strategy == "PROFILE_REPRODUCIBLE":
max_err = 1e-5
data1 = Tensor(np.random.random((32, 64)))
data2 = Tensor(np.random.random((64, 16)))
result = fwd(data1, data2)
check_pygraph_dump(fwd, [data1, data2], [result])
check_pygraph_dump(fwd, [data1, data2], [result], max_err=max_err)
set_execution_strategy(old)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册