We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7c09ca commit 1d15ac1Copy full SHA for 1d15ac1
torchvision/csrc/cuda/DeformConv_cuda.cu
@@ -74,7 +74,9 @@
74
75
#include "cuda_helpers.h"
76
77
+#include <cmath>
78
#include <iostream>
79
+#include <tuple>
80
81
using namespace at;
82
@@ -470,9 +472,9 @@ __global__ void deformable_col2im_gpu_kernel(
470
472
int yp = int(y) + dy;
471
473
int xp = int(x) + dx;
474
if (0 <= yp && yp < height && 0 <= xp && xp < width &&
- abs(y - yp) < 1 && abs(x - xp) < 1) {
475
+ std::abs(y - yp) < 1 && std::abs(x - xp) < 1) {
476
int grad_pos = ((b * channels + c) * height + yp) * width + xp;
- scalar_t weight = (1 - abs(y - yp)) * (1 - abs(x - xp));
477
+ scalar_t weight = (1 - std::abs(y - yp)) * (1 - std::abs(x - xp));
478
atomicAdd(grad_im + grad_pos, weight * col[index]);
479
}
480
0 commit comments