From ad57783925b56e9e8503b8597fbfca65e0a07563 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Wed, 25 Sep 2024 19:07:12 -0700 Subject: [PATCH] [ExecuTorch] UnaryUfuncRealHBToFloatHTest: test Half more widely The tests were trying to avoid Half in ATen mode, but that should work fine for these ops. Differential Revision: [D63435866](https://our.internmc.facebook.com/intern/diff/D63435866/) [ghstack-poisoned] --- kernels/test/UnaryUfuncRealHBToFloatHTest.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/kernels/test/UnaryUfuncRealHBToFloatHTest.cpp b/kernels/test/UnaryUfuncRealHBToFloatHTest.cpp index 6b34a30652a..0b749ad66fe 100644 --- a/kernels/test/UnaryUfuncRealHBToFloatHTest.cpp +++ b/kernels/test/UnaryUfuncRealHBToFloatHTest.cpp @@ -38,9 +38,6 @@ void UnaryUfuncRealHBToFloatHTest::test_mismatched_input_shapes_dies() { void UnaryUfuncRealHBToFloatHTest:: test_all_real_input_half_output_static_dynamism_support() { - if (torch::executor::testing::SupportedFeatures::get()->is_aten) { - GTEST_SKIP() << "Test Half support only for ExecuTorch mode"; - } #define TEST_ENTRY(ctype, dtype) \ test_floating_point_op_out< \ exec_aten::ScalarType::dtype, \ @@ -55,7 +52,7 @@ void UnaryUfuncRealHBToFloatHTest:: test_floating_point_op_out< \ exec_aten::ScalarType::dtype, \ exec_aten::ScalarType::Float>(); - ET_FORALL_REAL_TYPES(TEST_ENTRY); + ET_FORALL_REALH_TYPES(TEST_ENTRY); #undef TEST_ENTRY } @@ -65,15 +62,12 @@ void UnaryUfuncRealHBToFloatHTest:: test_floating_point_op_out< \ exec_aten::ScalarType::dtype, \ exec_aten::ScalarType::Double>(); - ET_FORALL_REAL_TYPES(TEST_ENTRY); + ET_FORALL_REALH_TYPES(TEST_ENTRY); #undef TEST_ENTRY } void UnaryUfuncRealHBToFloatHTest:: test_all_real_input_half_output_bound_dynamism_support() { - if (torch::executor::testing::SupportedFeatures::get()->is_aten) { - GTEST_SKIP() << "Test Half support only for ExecuTorch mode"; - } #define TEST_ENTRY(ctype, dtype) \ test_floating_point_op_out< \ exec_aten::ScalarType::dtype, \ @@ -90,7 +84,7 @@ void UnaryUfuncRealHBToFloatHTest:: exec_aten::ScalarType::dtype, \ exec_aten::ScalarType::Float>( \ {10, 10}, exec_aten::TensorShapeDynamism::DYNAMIC_BOUND); - ET_FORALL_REAL_TYPES(TEST_ENTRY); + ET_FORALL_REALH_TYPES(TEST_ENTRY); #undef TEST_ENTRY } @@ -101,7 +95,7 @@ void UnaryUfuncRealHBToFloatHTest:: exec_aten::ScalarType::dtype, \ exec_aten::ScalarType::Double>( \ {10, 10}, exec_aten::TensorShapeDynamism::DYNAMIC_BOUND); - ET_FORALL_REAL_TYPES(TEST_ENTRY); + ET_FORALL_REALH_TYPES(TEST_ENTRY); #undef TEST_ENTRY } @@ -115,7 +109,7 @@ void UnaryUfuncRealHBToFloatHTest:: exec_aten::ScalarType::dtype, \ exec_aten::ScalarType::Float>( \ {1, 1}, exec_aten::TensorShapeDynamism::DYNAMIC_UNBOUND); - ET_FORALL_REAL_TYPES(TEST_ENTRY); + ET_FORALL_REALH_TYPES(TEST_ENTRY); #undef TEST_ENTRY } @@ -129,7 +123,7 @@ void UnaryUfuncRealHBToFloatHTest:: exec_aten::ScalarType::dtype, \ exec_aten::ScalarType::Double>( \ {1, 1}, exec_aten::TensorShapeDynamism::DYNAMIC_UNBOUND); - ET_FORALL_REAL_TYPES(TEST_ENTRY); + ET_FORALL_REALH_TYPES(TEST_ENTRY); #undef TEST_ENTRY }