Skip to content

Commit d6b462d

Browse files
authored
Fix test-binary-size-linux -Wsign-compare failure with c10::irange (#13481)
#13199 broke it on Friday afternoon.
1 parent 4922d61 commit d6b462d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernels/portable/cpu/op_stack.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <cstring>
1010

11+
#include <c10/util/irange.h>
1112
#include <executorch/kernels/portable/cpu/util/copy_ops_util.h>
1213
#include <executorch/runtime/kernel/kernel_includes.h>
1314

@@ -126,7 +127,7 @@ stack_out_shape(executorch::aten::ArrayRef<Tensor> tensors, int64_t dim) {
126127
if (tensors[i].dim() != tensors[0].dim()) {
127128
return std::make_tuple(Error::InvalidArgument, out_sizes, out_dim);
128129
}
129-
for (size_t d = 0; d < tensors[0].dim(); ++d) {
130+
for (const auto d : c10::irange(tensors[0].dim())) {
130131
if (tensors[i].size(d) != tensors[0].size(d)) {
131132
return std::make_tuple(Error::InvalidArgument, out_sizes, out_dim);
132133
}

0 commit comments

Comments
 (0)