未验证 提交 a5de44f5 编写于 作者: L Leo Chen 提交者: GitHub

fix wrong place in ut (#42486)

上级 5a9d2d21
......@@ -919,7 +919,7 @@ class TestPureFp16InferenceSaveLoad(unittest.TestCase):
# load_inference_model
paddle.enable_static()
exe = paddle.static.Executor(paddle.CPUPlace())
exe = paddle.static.Executor()
[inference_program, feed_target_names, fetch_targets] = (
paddle.static.load_inference_model(path, exe))
tensor_img = x
......@@ -927,8 +927,8 @@ class TestPureFp16InferenceSaveLoad(unittest.TestCase):
feed={feed_target_names[0]: tensor_img},
fetch_list=fetch_targets)
print("pred.numpy()", pred.numpy())
print("results", results)
self.assertTrue(np.allclose(pred.numpy(), results, atol=1.e-5))
print("result", results[0])
self.assertTrue(np.array_equal(pred.numpy(), results[0]))
paddle.disable_static()
def test_inference_save_load(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册