Skip to content

Commit f173063

Browse files
committed
Update on "[executorch] Optimized 2D-by-1D broadcasting in optimized op_mul"
Detect that we are doing an elementwise multiplication for a 2D tensor and a 1D tensor. Dispatch to a vectorized kernel for this case. Differential Revision: [D61560826](https://our.internmc.facebook.com/intern/diff/D61560826/) [ghstack-poisoned]
2 parents a24fc2b + 5c02801 commit f173063

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

kernels/optimized/cpu/op_mul.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ template <
135135
typename CTYPE_OUT>
136136
struct MulInner<false, CTYPE_A, CTYPE_B, CTYPE_IN, CTYPE_OUT>
137137
: public ReportCanCastBug {};
138-
139-
Scalar tensor_to_scalar(RuntimeContext& ctx, const Tensor& t) {
140-
ET_DCHECK(t.numel() == 1);
141-
Scalar result;
142-
ET_SWITCH_REALHB_TYPES(t.scalar_type(), ctx, "mul.out", CTYPE, [&]() {
143-
result = Scalar(*t.const_data_ptr<CTYPE>());
144-
});
145-
return result;
146-
}
147138
} // namespace
148139

149140
Tensor& opt_mul_out(

0 commit comments

Comments
 (0)