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

fix bug in output check (#55164)

上级 71568672
......@@ -1146,21 +1146,25 @@ class OpTest(unittest.TestCase):
fetch_list=fetch_list,
return_numpy=False,
)
np.testing.assert_array_equal(
outs,
ir_outs,
err_msg='Operator ('
+ self.op_type
+ ') has diff at '
+ str(place)
+ '\nExpect '
+ str(outs)
+ '\n'
+ 'But Got'
+ str(ir_outs)
+ ' in class '
+ self.__class__.__name__,
)
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[i],
ir_outs[i],
err_msg='Operator Check ('
+ self.op_type
+ ') has diff at '
+ str(place)
+ '\nExpect '
+ str(outs[i])
+ '\n'
+ 'But Got'
+ str(ir_outs[i])
+ ' in class '
+ self.__class__.__name__,
)
set_flags({"FLAGS_enable_new_ir_in_executor": False})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册