Skip to content

Commit 832c314

Browse files
committed
Update on "[ET-SDK] Enable data_is_close for Half tensor"
Currently, if we use ET-SDK's `VerifyResultWithBundledExpectedOutput()` on `Half` tensors it will return true only if all elements are exactly equal. This change allows the common behavior to check that all elements are within the specified `rtol`/`atol`. Differential Revision: [D58018861](https://our.internmc.facebook.com/intern/diff/D58018861/) [ghstack-poisoned]
1 parent aa237f8 commit 832c314

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/bundled_program/bundled_program.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ TensorImpl impl_like(bundled_program_flatbuffer::Tensor* bundled_tensor) {
8282
template <
8383
typename T,
8484
typename = std::enable_if_t<std::is_floating_point<T>::value>>
85-
bool elem_is_close(const T ai, const T bi, double rtol, double atol) {
85+
bool elem_is_close(const T& ai, const T& bi, double rtol, double atol) {
8686
if (std::isnan(ai) && std::isnan(bi)) {
8787
// NaN == NaN
8888
} else if (

0 commit comments

Comments
 (0)