Skip to content

Commit

Permalink
Support BFloat16 in full_like
Browse files Browse the repository at this point in the history
Partial fix for #7748.

ghstack-source-id: 0c618dfefe4fe7c68fa6cfaddb442195371ef7cc
ghstack-comment-id: 2605975252
Pull Request resolved: #7822
  • Loading branch information
swolchok committed Jan 21, 2025
1 parent 466d98f commit fa3e694
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernels/portable/cpu/op_full_like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Tensor& full_like_out(
CTYPE_VAL val;
utils::extract_scalar(fill_value, &val);

ET_SWITCH_REALHB_TYPES(out_type, ctx, name, CTYPE_OUT, [&] {
ET_SWITCH_REALHBBF16_TYPES(out_type, ctx, name, CTYPE_OUT, [&] {
CTYPE_OUT val_casted = static_cast<CTYPE_OUT>(val);
auto data_out = out.mutable_data_ptr<CTYPE_OUT>();
for (size_t i = 0; i < out.numel(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion kernels/test/op_full_like_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void OpFullLikeTest::test_full_like_out<ScalarType::Bool>() {

TEST_F(OpFullLikeTest, AllRealOutputPasses) {
#define TEST_ENTRY(ctype, dtype) test_full_like_out<ScalarType::dtype>();
ET_FORALL_REAL_TYPES_AND(Bool, TEST_ENTRY);
ET_FORALL_REALHBF16_TYPES(TEST_ENTRY);
#undef TEST_ENTRY
}

Expand Down

0 comments on commit fa3e694

Please sign in to comment.