Skip to content

Commit 0451870

Browse files
committed
minor tweeks
1 parent 904b2b4 commit 0451870

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

kernels/optimized/cpu/op_bmm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ Tensor& opt_bmm_out(
150150
ET_KERNEL_CHECK(
151151
ctx, check_bmm_out_args(self, mat2, out), InvalidArgument, out);
152152

153-
auto self_type = self.scalar_type();
154-
155153
static constexpr auto name = "bmm.out";
156154

155+
auto self_type = self.scalar_type();
156+
157157
if (executorch::runtime::isComplexType(self_type)) {
158158
ET_SWITCH_COMPLEXH_TYPES(self_type, ctx, name, CTYPE, [&]() {
159159
bmm_kernel<CTYPE>(self, mat2, out);

kernels/portable/cpu/op_topk.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ void perform_topk(
117117
queue[i].second = i;
118118
}
119119

120-
// Perform topk on the queue
120+
// Perform topk on the queue, explict typing for the lambda to satisfy
121+
// msvc compiler.
121122
bool (*elem_greater)(const elem_t&, const elem_t&) =
122123
[](const elem_t& x, const elem_t& y) -> bool {
123124
return float_less_than(y.first, x.first);

kernels/portable/cpu/op_view_as_real_copy.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ Tensor& view_as_real_copy_out(
6464
ET_KERNEL_CHECK(
6565
ctx, tensors_have_same_dim_order(self, out), InvalidArgument, out);
6666

67-
ET_SWITCH_COMPLEXH_TYPES(
68-
self.scalar_type(), ctx, "view_as_real_copy.out", CTYPE_IN, [&] {
69-
ET_SWITCH_FLOATH_TYPES(
70-
out.scalar_type(), ctx, "view_as_real_copy.out", CTYPE_OUT, [&] {
71-
_to_impl<CTYPE_IN, CTYPE_OUT>(self, out);
72-
});
73-
});
67+
static constexpr auto op_name = "view_as_real_copy.out";
68+
69+
ET_SWITCH_COMPLEXH_TYPES(self.scalar_type(), ctx, op_name, CTYPE_IN, [&] {
70+
ET_SWITCH_FLOATH_TYPES(out.scalar_type(), ctx, op_name, CTYPE_OUT, [&] {
71+
_to_impl<CTYPE_IN, CTYPE_OUT>(self, out);
72+
});
73+
});
7474

7575
return out;
7676
}

0 commit comments

Comments
 (0)