Skip to content

Commit 444ffae

Browse files
authored
Fix unsigned comparison check in const pad kernel
Differential Revision: D96926279 Pull Request resolved: pytorch#18233
1 parent 043a3a1 commit 444ffae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernels/portable/cpu/op_constant_pad_nd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void constant_pad_nd_out_impl(
206206
out_strides[i] = getTrailingDims(out, static_cast<int64_t>(i));
207207

208208
size_t pad_i = ndim - 1 - i;
209-
if (pad_i >= 0 && pad_i < pad.size() / 2) {
209+
if (pad_i < pad.size() / 2) {
210210
if (pad[2 * pad_i] + pad[2 * pad_i + 1] > 0) {
211211
last_padded_dim = i;
212212
}

0 commit comments

Comments
 (0)