提交 4461a458 编写于 作者: T tensor-tang

adjust diff since abs is too large

test=develop
上级 ca6fdc6e
...@@ -327,7 +327,9 @@ TEST(Analyzer_seq_pool1, zerocopy_compare_native) { ...@@ -327,7 +327,9 @@ TEST(Analyzer_seq_pool1, zerocopy_compare_native) {
native_outputs.front().data.length()); native_outputs.front().data.length());
auto *native_data = static_cast<float *>(native_outputs.front().data.data()); auto *native_data = static_cast<float *>(native_outputs.front().data.data());
for (size_t i = 0; i < zerocopy_output.size(); ++i) { for (size_t i = 0; i < zerocopy_output.size(); ++i) {
EXPECT_NEAR(zerocopy_output[i], native_data[i], 1e-3); EXPECT_LT(
std::fabs((zerocopy_output[i] - native_data[i]) / zerocopy_output[i]),
1e-3);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册