@@ -72,20 +72,16 @@ class UnaryUfuncRealHBBF16ToFloatHBF16Test : public OperatorTest {
72
72
73
73
auto expected = tf_out.make ({1 , 6 }, expected_vector);
74
74
if (IN_DTYPE == ScalarType::BFloat16 || OUT_DTYPE == ScalarType::BFloat16) {
75
- double rtol = executorch::runtime::testing::internal::kDefaultRtol ;
76
- // It appears we need a higher tolerance for at least some ATen
77
- // tests, like aten_op_acosh_test.
78
- if (get_supported_features ()->is_aten ) {
79
- rtol = 3e-3 ;
80
- }
75
+ // Raise tolerance because both we and ATen run these
76
+ // computations at internal float32 precision rather than
77
+ // float64.
78
+ double rtol = 3e-3 ;
81
79
EXPECT_TENSOR_CLOSE_WITH_TOL (out, expected, rtol, executorch::runtime::testing::internal::kDefaultBFloat16Atol );
82
80
} else if (IN_DTYPE == ScalarType::Half || OUT_DTYPE == ScalarType::Half) {
83
- double rtol = executorch::runtime::testing::internal::kDefaultRtol ;
84
- // It appears we need a higher tolerance for at least some ATen
85
- // tests, like aten_op_acosh_test.
86
- if (get_supported_features ()->is_aten ) {
87
- rtol = 1e-3 ;
88
- }
81
+ // Raise tolerance because both we and ATen run these
82
+ // computations at internal float32 precision rather than
83
+ // float64.
84
+ double rtol = 1e-3 ;
89
85
EXPECT_TENSOR_CLOSE_WITH_TOL (out, expected, rtol, executorch::runtime::testing::internal::kDefaultHalfAtol );
90
86
} else {
91
87
EXPECT_TENSOR_CLOSE (out, expected);
0 commit comments