@@ -144,13 +144,13 @@ Tensor& opt_add_sub_out_impl(
144
144
} else if (selected_optimized_path != ElementwiseOptimizedPath::kNone ) {
145
145
// Cannot apply the trick of -alpha here because alpha is Scalar without
146
146
// support for - operator. At least not right now.
147
- ET_SWITCH_REALB_TYPES (out_type, ctx, op_name, CTYPE, [&]() {
147
+ ET_SWITCH_REALB_TYPES (out_type, ctx, op_name, CTYPE, [&]() -> void {
148
148
CTYPE alpha_val;
149
149
ET_KERNEL_CHECK_MSG (
150
150
ctx,
151
151
torch::executor::native::utils::extract_scalar (alpha, &alpha_val),
152
152
InvalidArgument,
153
- out ,
153
+ ,
154
154
" Failed to extract scalar alpha." );
155
155
using Vec = at::vec::Vectorized<CTYPE>;
156
156
Vec alpha_val_vec (alpha_val);
@@ -164,13 +164,13 @@ Tensor& opt_add_sub_out_impl(
164
164
auto add_lambda = [&alpha_val_vec](auto x, auto y) {
165
165
return y - alpha_val_vec * x;
166
166
};
167
- return torch::executor::handle_broadcast_elementwise<CTYPE>(
167
+ torch::executor::handle_broadcast_elementwise<CTYPE>(
168
168
ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
169
169
} else {
170
170
auto add_lambda = [&alpha_val_vec](auto x, auto y) {
171
171
return x - alpha_val_vec * y;
172
172
};
173
- return torch::executor::handle_broadcast_elementwise<CTYPE>(
173
+ torch::executor::handle_broadcast_elementwise<CTYPE>(
174
174
ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
175
175
}
176
176
} else {
@@ -191,13 +191,13 @@ Tensor& opt_add_sub_out_impl(
191
191
auto add_lambda = [&alpha_val_vec](auto x, auto y) {
192
192
return y + alpha_val_vec * x;
193
193
};
194
- return torch::executor::handle_broadcast_elementwise<CTYPE>(
194
+ torch::executor::handle_broadcast_elementwise<CTYPE>(
195
195
ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
196
196
} else {
197
197
auto add_lambda = [&alpha_val_vec](auto x, auto y) {
198
198
return x + alpha_val_vec * y;
199
199
};
200
- return torch::executor::handle_broadcast_elementwise<CTYPE>(
200
+ torch::executor::handle_broadcast_elementwise<CTYPE>(
201
201
ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
202
202
}
203
203
}
0 commit comments