From cbf502e5d4ab2ac8742fc461cafdd4e5c983716e Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Wed, 9 May 2018 14:24:00 -0700 Subject: [PATCH] fix error --- paddle/fluid/operators/save_load_op_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/save_load_op_test.cc b/paddle/fluid/operators/save_load_op_test.cc index 6a5ae0134..9c1546130 100644 --- a/paddle/fluid/operators/save_load_op_test.cc +++ b/paddle/fluid/operators/save_load_op_test.cc @@ -125,21 +125,21 @@ TEST(LoadFP16Op, CPU) { save_op->Run(scope, place); auto load_var = scope.Var("out_var"); - auto target = load_var->GetMutable(); auto load_op = paddle::framework::OpRegistry::CreateOp( "load", {}, {{"Out", {"out_var"}}}, attrs); LOG(INFO) << "before load op run"; load_op->Run(scope, place); LOG(INFO) << "after load op run"; - paddle::platform::float16* actual = target->data(); + auto target = load_var->Get(); + paddle::platform::float16* actual = target.data(); LOG(INFO) << "after target->data"; for (int64_t i = 0; i < tensor->numel(); ++i) { EXPECT_EQ(expect[i], static_cast(actual[i])); } LOG(INFO) << "after expect equal"; - auto& actual_lod = target->lod(); + auto& actual_lod = target.lod(); EXPECT_EQ(expect_lod.size(), actual_lod.size()); for (size_t i = 0; i < expect_lod.size(); ++i) { for (size_t j = 0; j < expect_lod[i].size(); ++j) { -- GitLab