@@ -144,13 +144,13 @@ Tensor& opt_add_sub_out_impl(
144144 } else if (selected_optimized_path != ElementwiseOptimizedPath::kNone ) {
145145 // Cannot apply the trick of -alpha here because alpha is Scalar without
146146 // 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 {
148148 CTYPE alpha_val;
149149 ET_KERNEL_CHECK_MSG (
150150 ctx,
151151 torch::executor::native::utils::extract_scalar (alpha, &alpha_val),
152152 InvalidArgument,
153- out ,
153+ ,
154154 " Failed to extract scalar alpha." );
155155 using Vec = at::vec::Vectorized<CTYPE>;
156156 Vec alpha_val_vec (alpha_val);
@@ -164,13 +164,13 @@ Tensor& opt_add_sub_out_impl(
164164 auto add_lambda = [&alpha_val_vec](auto x, auto y) {
165165 return y - alpha_val_vec * x;
166166 };
167- return torch::executor::handle_broadcast_elementwise<CTYPE>(
167+ torch::executor::handle_broadcast_elementwise<CTYPE>(
168168 ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
169169 } else {
170170 auto add_lambda = [&alpha_val_vec](auto x, auto y) {
171171 return x - alpha_val_vec * y;
172172 };
173- return torch::executor::handle_broadcast_elementwise<CTYPE>(
173+ torch::executor::handle_broadcast_elementwise<CTYPE>(
174174 ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
175175 }
176176 } else {
@@ -191,13 +191,13 @@ Tensor& opt_add_sub_out_impl(
191191 auto add_lambda = [&alpha_val_vec](auto x, auto y) {
192192 return y + alpha_val_vec * x;
193193 };
194- return torch::executor::handle_broadcast_elementwise<CTYPE>(
194+ torch::executor::handle_broadcast_elementwise<CTYPE>(
195195 ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
196196 } else {
197197 auto add_lambda = [&alpha_val_vec](auto x, auto y) {
198198 return x + alpha_val_vec * y;
199199 };
200- return torch::executor::handle_broadcast_elementwise<CTYPE>(
200+ torch::executor::handle_broadcast_elementwise<CTYPE>(
201201 ctx, add_lambda, a, b, out, selected_optimized_path, alpha);
202202 }
203203 }
0 commit comments