File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -217,11 +217,11 @@ void grid_sample_2d_nearest_kernel_impl_nchw(
217217 // For border/reflection padding, clip coordinates after rounding
218218 // Rounding can push coordinates out of bounds even after
219219 // grid_sampler_compute_source_index
220- ix_nearest = clip_coordinates (ix_nearest, inp_W);
221- iy_nearest = clip_coordinates (iy_nearest, inp_H);
220+ int64_t ix_clipped = clip_coordinates (ix_nearest, inp_W);
221+ int64_t iy_clipped = clip_coordinates (iy_nearest, inp_H);
222222 out_val = in_data
223- [in_channel_offset + iy_nearest * in.strides ()[2 ] +
224- ix_nearest * in.strides ()[3 ]];
223+ [in_channel_offset + iy_clipped * in.strides ()[2 ] +
224+ ix_clipped * in.strides ()[3 ]];
225225 }
226226
227227 // Write output in NCHW order
You can’t perform that action at this time.
0 commit comments