Skip to content

Commit efba1c7

Browse files
committed
address comments
1 parent 6c88f1a commit efba1c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/fluid/operators/save_load_op_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License. */
1414

1515
#include "gtest/gtest.h"
1616
#include "paddle/fluid/framework/op_registry.h"
17+
#include "paddle/fluid/platform/float16.h"
1718

1819
USE_NO_KERNEL_OP(save);
1920
USE_NO_KERNEL_OP(load);
@@ -72,7 +73,7 @@ TEST(SaveLoadFP16Op, CPU) {
7273

7374
float* expect = tensor->mutable_data<float>(place);
7475
for (int64_t i = 0; i < tensor->numel(); ++i) {
75-
expect[i] = static_cast<float>(i);
76+
expect[i] = static_cast<float>(paddle::platform::float16(i));
7677
}
7778

7879
paddle::framework::AttributeMap attrs;

0 commit comments

Comments
 (0)