From efba1c7dcb46ededcf1e2b70b3955b1e83a02359 Mon Sep 17 00:00:00 2001 From: Kexin Zhao Date: Fri, 27 Apr 2018 11:48:50 -0700 Subject: [PATCH] address comments --- paddle/fluid/operators/save_load_op_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/save_load_op_test.cc b/paddle/fluid/operators/save_load_op_test.cc index 0cfb7fb73..74385ee47 100644 --- a/paddle/fluid/operators/save_load_op_test.cc +++ b/paddle/fluid/operators/save_load_op_test.cc @@ -14,6 +14,7 @@ limitations under the License. */ #include "gtest/gtest.h" #include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/platform/float16.h" USE_NO_KERNEL_OP(save); USE_NO_KERNEL_OP(load); @@ -72,7 +73,7 @@ TEST(SaveLoadFP16Op, CPU) { float* expect = tensor->mutable_data(place); for (int64_t i = 0; i < tensor->numel(); ++i) { - expect[i] = static_cast(i); + expect[i] = static_cast(paddle::platform::float16(i)); } paddle::framework::AttributeMap attrs; -- GitLab