mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-28 20:11:22 +00:00
Fix an error in test/shared_lib/test_inference.cc (#16090)
### Description Fix an error in test/shared_lib/test_inference.cc. It should use ASSERT_NEAR to test float values. ### Motivation and Context Our OpenVino pipeline is failing because of this.
This commit is contained in:
parent
76fd9aa745
commit
cc0c5e5612
1 changed files with 5 additions and 1 deletions
|
|
@ -81,7 +81,11 @@ void RunSession(OrtAllocator* allocator, Ort::Session& session_object,
|
|||
|
||||
OutT* f = output_tensor->GetTensorMutableData<OutT>();
|
||||
for (size_t i = 0; i != total_len; ++i) {
|
||||
ASSERT_EQ(values_y[i], f[i]);
|
||||
if constexpr (std::is_same<OutT, float>::value || std::is_same<OutT, double>::value) {
|
||||
ASSERT_NEAR(values_y[i], f[i], 1e-3);
|
||||
} else {
|
||||
ASSERT_EQ(values_y[i], f[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue