Skip to content

Commit

Permalink
fix wrong place in ut (#42486)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu committed May 5, 2022
1 parent 5a9d2d2 commit a5de44f
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -919,16 +919,16 @@ def train(layer, loader, loss_fn, opt):

# 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
results = exe.run(inference_program,
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):
Expand Down

0 comments on commit a5de44f

Please sign in to comment.