Skip to content

Commit

Permalink
switch to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesShang committed Dec 7, 2018
1 parent f96a1c5 commit bd685e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dcn_v2_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void dcn_v2_cuda_forward(THCudaTensor *input, THCudaTensor *weight,
const int height_out = (height + 2 * pad_h - (dilation_h * (kernel_h - 1) + 1)) / stride_h + 1;
const int width_out = (width + 2 * pad_w - (dilation_w * (kernel_w - 1) + 1)) / stride_w + 1;

if (THCudaTensor__nDimension(state, ones) != 2 ||
if (THCudaTensor_nDimension(state, ones) != 2 ||
THCudaTensor_size(state, ones, 0) * THCudaTensor_size(state, ones, 1) < height_out * width_out)
{
// Resize plane and fill with ones...
Expand Down Expand Up @@ -138,7 +138,7 @@ void dcn_v2_cuda_backward(THCudaTensor *input, THCudaTensor *weight,
const int height_out = (height + 2 * pad_h - (dilation_h * (kernel_h - 1) + 1)) / stride_h + 1;
const int width_out = (width + 2 * pad_w - (dilation_w * (kernel_w - 1) + 1)) / stride_w + 1;

if (THCudaTensor__nDimension(state, ones) != 2 ||
if (THCudaTensor_nDimension(state, ones) != 2 ||
THCudaTensor_size(state, ones, 0) * THCudaTensor_size(state, ones, 1) < height_out * width_out)
{
// Resize plane and fill with ones...
Expand Down
4 changes: 2 additions & 2 deletions src/dcn_v2_cuda_double.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void dcn_v2_cuda_forward(THCudaDoubleTensor *input, THCudaDoubleTensor *weight,
const int height_out = (height + 2 * pad_h - (dilation_h * (kernel_h - 1) + 1)) / stride_h + 1;
const int width_out = (width + 2 * pad_w - (dilation_w * (kernel_w - 1) + 1)) / stride_w + 1;

if (THCudaDoubleTensor__nDimension(state, ones) != 2 ||
if (THCudaDoubleTensor_nDimension(state, ones) != 2 ||
THCudaDoubleTensor_size(state, ones, 0) * THCudaDoubleTensor_size(state, ones, 1) < height_out * width_out)
{
// Resize plane and fill with ones...
Expand Down Expand Up @@ -154,7 +154,7 @@ void dcn_v2_cuda_backward(THCudaDoubleTensor *input, THCudaDoubleTensor *weight,
const int height_out = (height + 2 * pad_h - (dilation_h * (kernel_h - 1) + 1)) / stride_h + 1;
const int width_out = (width + 2 * pad_w - (dilation_w * (kernel_w - 1) + 1)) / stride_w + 1;

if (THCudaDoubleTensor__nDimension(state, ones) != 2 ||
if (THCudaDoubleTensor_nDimension(state, ones) != 2 ||
THCudaDoubleTensor_size(state, ones, 0) * THCudaDoubleTensor_size(state, ones, 1) < height_out * width_out)
{
// Resize plane and fill with ones...
Expand Down

0 comments on commit bd685e4

Please sign in to comment.