Skip to content

Commit 8c0ca33

Browse files
committed
fix ut test=develop
1 parent 371c20c commit 8c0ca33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/fluid/operators/collective/c_allreduce_sum_op_npu_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ void TestHCCLAllReduceOp(f::Scope* scope, const p::DeviceContext& ctx,
175175

176176
PrintDebugInfo("output data", out_vec);
177177

178-
EXPECT_TRUE((static_cast<float>(out_vec[0]) - 65504) < 0.1);
178+
float diff = static_cast<float>(out_vec[0]) - 65504;
179+
EXPECT_TRUE(diff < 0.1 && diff > -0.1);
179180
EXPECT_EQ(out_vec.size(), init.size());
180181
for (uint32_t i = 1; i < 10; i++) {
181182
EXPECT_EQ(out_vec[i], static_cast<paddle::platform::float16>(3.0));

0 commit comments

Comments
 (0)