未验证 提交 190e8074 编写于 作者: K kangguangli 提交者: GitHub

fix bug in output check (#55164)

上级 71568672
......@@ -1146,18 +1146,22 @@ class OpTest(unittest.TestCase):
fetch_list=fetch_list,
return_numpy=False,
)
assert len(outs) == len(
ir_outs
), "Fetch result should have same length when executed in new ir"
for i in range(len(outs)):
np.testing.assert_array_equal(
outs,
ir_outs,
err_msg='Operator ('
outs[i],
ir_outs[i],
err_msg='Operator Check ('
+ self.op_type
+ ') has diff at '
+ str(place)
+ '\nExpect '
+ str(outs)
+ str(outs[i])
+ '\n'
+ 'But Got'
+ str(ir_outs)
+ str(ir_outs[i])
+ ' in class '
+ self.__class__.__name__,
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册