Skip to content

Commit b40492f

Browse files
committed
Support Half/BFloat16 in upsmple_bilinear2d
Partial fix for #7748. ghstack-source-id: 5b09712 ghstack-comment-id: 2611090027 Pull Request resolved: #7910
1 parent 70f9b5d commit b40492f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

kernels/portable/cpu/op_upsample_bilinear2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Tensor& upsample_bilinear2d_vec_out(
123123
const auto kernel_scale_w = area_pixel_compute_scale<double>(
124124
in.sizes()[3], out.sizes()[3], align_corners, scale_w);
125125

126-
ET_SWITCH_REAL_TYPES(
126+
ET_SWITCH_REALHBF16_TYPES(
127127
in.scalar_type(), ctx, "upsample_bilinear2d.out", CTYPE, [&]() {
128128
upsample_bilinear2d_kernel_impl<CTYPE>(
129129
in, align_corners, kernel_scale_h, kernel_scale_w, out);

kernels/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ set(all_test_sources
229229
"op_trunc_test.cpp"
230230
"op_unbind_copy_test.cpp"
231231
"op_unsqueeze_copy_test.cpp"
232+
"op_upsample_bilinear2d_test.cpp"
232233
"op_var_test.cpp"
233234
"op_view_copy_test.cpp"
234235
"op_where_test.cpp"

kernels/test/op_upsample_bilinear2d_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ TEST_F(OpUpsampleBilinear2dTest, SmokeTestAlignCornersScales) {
302302
}
303303

304304
TEST_F(OpUpsampleBilinear2dTest, DType) {
305-
#define TEST_ENTRY(ctype, dtype) \
306-
test_upsample_bilinear2d_dtype<ctype, ScalarType::dtype>(); \
307-
ET_FORALL_REAL_TYPES(TEST_ENTRY);
305+
#define TEST_ENTRY(ctype, dtype) \
306+
test_upsample_bilinear2d_dtype<ctype, ScalarType::dtype>();
307+
ET_FORALL_REALHBF16_TYPES(TEST_ENTRY);
308308
#undef TEST_ENTRY
309309
}
310310

0 commit comments

Comments
 (0)