Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BFloat16 in full_like #7822

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the boolean. Use ET_FORALL_REALHBBF16_TYPES. Granted that the test name was misleading. Could you please change that as well. AllRealOutputPasses -> AllDtypeOutputPasses

#undef TEST_ENTRY
}

Expand Down
Loading