Skip to content

Commit 08a2861

Browse files
committed
[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-source-id: 244772169 Pull Request resolved: #5676
1 parent 5fc2f05 commit 08a2861

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

kernels/test/UnaryUfuncRealHBToFloatHTest.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ void UnaryUfuncRealHBToFloatHTest::test_mismatched_input_shapes_dies() {
3838

3939
void UnaryUfuncRealHBToFloatHTest::
4040
test_all_real_input_half_output_static_dynamism_support() {
41-
if (torch::executor::testing::SupportedFeatures::get()->is_aten) {
42-
GTEST_SKIP() << "Test Half support only for ExecuTorch mode";
43-
}
4441
#define TEST_ENTRY(ctype, dtype) \
4542
test_floating_point_op_out< \
4643
exec_aten::ScalarType::dtype, \
@@ -55,7 +52,7 @@ void UnaryUfuncRealHBToFloatHTest::
5552
test_floating_point_op_out< \
5653
exec_aten::ScalarType::dtype, \
5754
exec_aten::ScalarType::Float>();
58-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
55+
ET_FORALL_REALH_TYPES(TEST_ENTRY);
5956
#undef TEST_ENTRY
6057
}
6158

@@ -65,15 +62,12 @@ void UnaryUfuncRealHBToFloatHTest::
6562
test_floating_point_op_out< \
6663
exec_aten::ScalarType::dtype, \
6764
exec_aten::ScalarType::Double>();
68-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
65+
ET_FORALL_REALH_TYPES(TEST_ENTRY);
6966
#undef TEST_ENTRY
7067
}
7168

7269
void UnaryUfuncRealHBToFloatHTest::
7370
test_all_real_input_half_output_bound_dynamism_support() {
74-
if (torch::executor::testing::SupportedFeatures::get()->is_aten) {
75-
GTEST_SKIP() << "Test Half support only for ExecuTorch mode";
76-
}
7771
#define TEST_ENTRY(ctype, dtype) \
7872
test_floating_point_op_out< \
7973
exec_aten::ScalarType::dtype, \
@@ -90,7 +84,7 @@ void UnaryUfuncRealHBToFloatHTest::
9084
exec_aten::ScalarType::dtype, \
9185
exec_aten::ScalarType::Float>( \
9286
{10, 10}, exec_aten::TensorShapeDynamism::DYNAMIC_BOUND);
93-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
87+
ET_FORALL_REALH_TYPES(TEST_ENTRY);
9488
#undef TEST_ENTRY
9589
}
9690

@@ -101,7 +95,7 @@ void UnaryUfuncRealHBToFloatHTest::
10195
exec_aten::ScalarType::dtype, \
10296
exec_aten::ScalarType::Double>( \
10397
{10, 10}, exec_aten::TensorShapeDynamism::DYNAMIC_BOUND);
104-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
98+
ET_FORALL_REALH_TYPES(TEST_ENTRY);
10599
#undef TEST_ENTRY
106100
}
107101

@@ -115,7 +109,7 @@ void UnaryUfuncRealHBToFloatHTest::
115109
exec_aten::ScalarType::dtype, \
116110
exec_aten::ScalarType::Float>( \
117111
{1, 1}, exec_aten::TensorShapeDynamism::DYNAMIC_UNBOUND);
118-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
112+
ET_FORALL_REALH_TYPES(TEST_ENTRY);
119113
#undef TEST_ENTRY
120114
}
121115

@@ -129,7 +123,7 @@ void UnaryUfuncRealHBToFloatHTest::
129123
exec_aten::ScalarType::dtype, \
130124
exec_aten::ScalarType::Double>( \
131125
{1, 1}, exec_aten::TensorShapeDynamism::DYNAMIC_UNBOUND);
132-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
126+
ET_FORALL_REALH_TYPES(TEST_ENTRY);
133127
#undef TEST_ENTRY
134128
}
135129

0 commit comments

Comments
 (0)