Skip to content

Commit 6467b58

Browse files
committed
Reorder declarations for clarity
1 parent d9c8dbe commit 6467b58

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

torchvision/csrc/cpu/DeformConv_cpu.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,16 @@ static void deformable_col2im_kernel(
428428
const int out_w,
429429
scalar_t* grad_im) {
430430
for (int index = 0; index != n; ++index) {
431+
const int out_x = index % out_w;
432+
const int out_y = (index / out_w) % out_h;
433+
const int b = (index / (out_w * out_h)) % batch_sz;
431434
const int j = (index / (out_w * out_h * batch_sz)) % kernel_w;
432435
const int i = (index / (out_w * out_h * batch_sz * kernel_w)) % kernel_h;
433436
const int c = index / (out_w * out_h * batch_sz * kernel_w * kernel_h);
434437

435438
int c_per_offset_grp = channels / n_offset_grps;
436439
const int offset_grp = c / c_per_offset_grp;
437440

438-
int out_x = index % out_w;
439-
int out_y = (index / out_w) % out_h;
440-
int b = (index / (out_w * out_h)) % batch_sz;
441-
442441
auto offset_ptr = offset +
443442
(b * n_offset_grps + offset_grp) * 2 * kernel_h * kernel_w * out_h *
444443
out_w;

0 commit comments

Comments
 (0)