Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
RODNet
Commits
66101bd4
"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "f96deba0f834d7b9566e8f3c1783d9e0a1c5b5af"
Commit
66101bd4
authored
Sep 28, 2025
by
fengzch-das
Browse files
fix: AT_CHECK has been deprecated
parent
8873a510
Pipeline
#2952
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
48 deletions
+48
-48
rodnet/ops/dcn/src/deform_conv_2d_cuda.cpp
rodnet/ops/dcn/src/deform_conv_2d_cuda.cpp
+21
-21
rodnet/ops/dcn/src/deform_conv_3d_cuda.cpp
rodnet/ops/dcn/src/deform_conv_3d_cuda.cpp
+21
-21
rodnet/ops/dcn/src/deform_pool_2d_cuda.cpp
rodnet/ops/dcn/src/deform_pool_2d_cuda.cpp
+3
-3
rodnet/ops/dcn/src/deform_pool_3d_cuda.cpp
rodnet/ops/dcn/src/deform_pool_3d_cuda.cpp
+3
-3
No files found.
rodnet/ops/dcn/src/deform_conv_2d_cuda.cpp
View file @
66101bd4
...
@@ -63,26 +63,26 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -63,26 +63,26 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
at
::
Tensor
weight
,
int
kH
,
int
kW
,
int
dH
,
int
dW
,
int
padH
,
at
::
Tensor
weight
,
int
kH
,
int
kW
,
int
dH
,
int
dW
,
int
padH
,
int
padW
,
int
dilationH
,
int
dilationW
,
int
group
,
int
padW
,
int
dilationH
,
int
dilationW
,
int
group
,
int
deformable_group
)
{
int
deformable_group
)
{
A
T_CHECK
(
weight
.
ndimension
()
==
4
,
T
ORCH
_CHECK
(
weight
.
ndimension
()
==
4
,
"4D weight tensor (nOutputPlane,nInputPlane,kH,kW) expected, "
"4D weight tensor (nOutputPlane,nInputPlane,kH,kW) expected, "
"but got: %s"
,
"but got: %s"
,
weight
.
ndimension
());
weight
.
ndimension
());
A
T_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
T
ORCH
_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
A
T_CHECK
(
kW
>
0
&&
kH
>
0
,
T
ORCH
_CHECK
(
kW
>
0
&&
kH
>
0
,
"kernel size should be greater than zero, but got kH: %d kW: %d"
,
kH
,
"kernel size should be greater than zero, but got kH: %d kW: %d"
,
kH
,
kW
);
kW
);
A
T_CHECK
((
weight
.
size
(
2
)
==
kH
&&
weight
.
size
(
3
)
==
kW
),
T
ORCH
_CHECK
((
weight
.
size
(
2
)
==
kH
&&
weight
.
size
(
3
)
==
kW
),
"kernel size should be consistent with weight, "
,
"kernel size should be consistent with weight, "
,
"but got kH: %d kW: %d weight.size(2): %d, weight.size(3): %d"
,
kH
,
"but got kH: %d kW: %d weight.size(2): %d, weight.size(3): %d"
,
kH
,
kW
,
weight
.
size
(
2
),
weight
.
size
(
3
));
kW
,
weight
.
size
(
2
),
weight
.
size
(
3
));
A
T_CHECK
(
dW
>
0
&&
dH
>
0
,
T
ORCH
_CHECK
(
dW
>
0
&&
dH
>
0
,
"stride should be greater than zero, but got dH: %d dW: %d"
,
dH
,
dW
);
"stride should be greater than zero, but got dH: %d dW: %d"
,
dH
,
dW
);
A
T_CHECK
(
T
ORCH
_CHECK
(
dilationW
>
0
&&
dilationH
>
0
,
dilationW
>
0
&&
dilationH
>
0
,
"dilation should be greater than 0, but got dilationH: %d dilationW: %d"
,
"dilation should be greater than 0, but got dilationH: %d dilationW: %d"
,
dilationH
,
dilationW
);
dilationH
,
dilationW
);
...
@@ -98,7 +98,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -98,7 +98,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
dimw
++
;
dimw
++
;
}
}
A
T_CHECK
(
ndim
==
3
||
ndim
==
4
,
"3D or 4D input tensor expected but got: %s"
,
T
ORCH
_CHECK
(
ndim
==
3
||
ndim
==
4
,
"3D or 4D input tensor expected but got: %s"
,
ndim
);
ndim
);
long
nInputPlane
=
weight
.
size
(
1
)
*
group
;
long
nInputPlane
=
weight
.
size
(
1
)
*
group
;
...
@@ -110,7 +110,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -110,7 +110,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
long
outputWidth
=
long
outputWidth
=
(
inputWidth
+
2
*
padW
-
(
dilationW
*
(
kW
-
1
)
+
1
))
/
dW
+
1
;
(
inputWidth
+
2
*
padW
-
(
dilationW
*
(
kW
-
1
)
+
1
))
/
dW
+
1
;
A
T_CHECK
(
nInputPlane
%
deformable_group
==
0
,
T
ORCH
_CHECK
(
nInputPlane
%
deformable_group
==
0
,
"input channels must divide deformable group size"
);
"input channels must divide deformable group size"
);
if
(
outputWidth
<
1
||
outputHeight
<
1
)
if
(
outputWidth
<
1
||
outputHeight
<
1
)
...
@@ -120,27 +120,27 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -120,27 +120,27 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
nInputPlane
,
inputHeight
,
inputWidth
,
nOutputPlane
,
outputHeight
,
nInputPlane
,
inputHeight
,
inputWidth
,
nOutputPlane
,
outputHeight
,
outputWidth
);
outputWidth
);
A
T_CHECK
(
input
.
size
(
1
)
==
nInputPlane
,
T
ORCH
_CHECK
(
input
.
size
(
1
)
==
nInputPlane
,
"invalid number of input planes, expected: %d, but got: %d"
,
"invalid number of input planes, expected: %d, but got: %d"
,
nInputPlane
,
input
.
size
(
1
));
nInputPlane
,
input
.
size
(
1
));
A
T_CHECK
((
inputHeight
>=
kH
&&
inputWidth
>=
kW
),
T
ORCH
_CHECK
((
inputHeight
>=
kH
&&
inputWidth
>=
kW
),
"input image is smaller than kernel"
);
"input image is smaller than kernel"
);
A
T_CHECK
((
offset
.
size
(
2
)
==
outputHeight
&&
offset
.
size
(
3
)
==
outputWidth
),
T
ORCH
_CHECK
((
offset
.
size
(
2
)
==
outputHeight
&&
offset
.
size
(
3
)
==
outputWidth
),
"invalid spatial size of offset, expected height: %d width: %d, but "
"invalid spatial size of offset, expected height: %d width: %d, but "
"got height: %d width: %d"
,
"got height: %d width: %d"
,
outputHeight
,
outputWidth
,
offset
.
size
(
2
),
offset
.
size
(
3
));
outputHeight
,
outputWidth
,
offset
.
size
(
2
),
offset
.
size
(
3
));
A
T_CHECK
((
offset
.
size
(
1
)
==
deformable_group
*
2
*
kH
*
kW
),
T
ORCH
_CHECK
((
offset
.
size
(
1
)
==
deformable_group
*
2
*
kH
*
kW
),
"invalid number of channels of offset"
);
"invalid number of channels of offset"
);
if
(
gradOutput
!=
NULL
)
{
if
(
gradOutput
!=
NULL
)
{
A
T_CHECK
(
gradOutput
->
size
(
dimf
)
==
nOutputPlane
,
T
ORCH
_CHECK
(
gradOutput
->
size
(
dimf
)
==
nOutputPlane
,
"invalid number of gradOutput planes, expected: %d, but got: %d"
,
"invalid number of gradOutput planes, expected: %d, but got: %d"
,
nOutputPlane
,
gradOutput
->
size
(
dimf
));
nOutputPlane
,
gradOutput
->
size
(
dimf
));
A
T_CHECK
((
gradOutput
->
size
(
dimh
)
==
outputHeight
&&
T
ORCH
_CHECK
((
gradOutput
->
size
(
dimh
)
==
outputHeight
&&
gradOutput
->
size
(
dimw
)
==
outputWidth
),
gradOutput
->
size
(
dimw
)
==
outputWidth
),
"invalid size of gradOutput, expected height: %d width: %d , but "
"invalid size of gradOutput, expected height: %d width: %d , but "
"got height: %d width: %d"
,
"got height: %d width: %d"
,
...
@@ -191,7 +191,7 @@ int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight,
...
@@ -191,7 +191,7 @@ int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight,
long
outputHeight
=
long
outputHeight
=
(
inputHeight
+
2
*
padH
-
(
dilationH
*
(
kH
-
1
)
+
1
))
/
dH
+
1
;
(
inputHeight
+
2
*
padH
-
(
dilationH
*
(
kH
-
1
)
+
1
))
/
dH
+
1
;
A
T_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
T
ORCH
_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
output
=
output
.
view
({
batchSize
/
im2col_step
,
im2col_step
,
nOutputPlane
,
output
=
output
.
view
({
batchSize
/
im2col_step
,
im2col_step
,
nOutputPlane
,
outputHeight
,
outputWidth
});
outputHeight
,
outputWidth
});
...
@@ -298,7 +298,7 @@ int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset,
...
@@ -298,7 +298,7 @@ int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset,
long
outputHeight
=
long
outputHeight
=
(
inputHeight
+
2
*
padH
-
(
dilationH
*
(
kH
-
1
)
+
1
))
/
dH
+
1
;
(
inputHeight
+
2
*
padH
-
(
dilationH
*
(
kH
-
1
)
+
1
))
/
dH
+
1
;
A
T_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
3
,
"invalid batch size of offset"
);
T
ORCH
_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
3
,
"invalid batch size of offset"
);
gradInput
=
gradInput
.
view
({
batchSize
,
nInputPlane
,
inputHeight
,
inputWidth
});
gradInput
=
gradInput
.
view
({
batchSize
,
nInputPlane
,
inputHeight
,
inputWidth
});
columns
=
at
::
zeros
(
columns
=
at
::
zeros
(
{
nInputPlane
*
kW
*
kH
,
im2col_step
*
outputHeight
*
outputWidth
},
{
nInputPlane
*
kW
*
kH
,
im2col_step
*
outputHeight
*
outputWidth
},
...
@@ -414,7 +414,7 @@ int deform_conv_backward_parameters_cuda(
...
@@ -414,7 +414,7 @@ int deform_conv_backward_parameters_cuda(
long
outputHeight
=
long
outputHeight
=
(
inputHeight
+
2
*
padH
-
(
dilationH
*
(
kH
-
1
)
+
1
))
/
dH
+
1
;
(
inputHeight
+
2
*
padH
-
(
dilationH
*
(
kH
-
1
)
+
1
))
/
dH
+
1
;
A
T_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
T
ORCH
_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
columns
=
at
::
zeros
(
columns
=
at
::
zeros
(
{
nInputPlane
*
kW
*
kH
,
im2col_step
*
outputHeight
*
outputWidth
},
{
nInputPlane
*
kW
*
kH
,
im2col_step
*
outputHeight
*
outputWidth
},
...
@@ -494,8 +494,8 @@ void modulated_deform_conv_cuda_forward(
...
@@ -494,8 +494,8 @@ void modulated_deform_conv_cuda_forward(
const
int
pad_h
,
const
int
pad_w
,
const
int
dilation_h
,
const
int
pad_h
,
const
int
pad_w
,
const
int
dilation_h
,
const
int
dilation_w
,
const
int
group
,
const
int
deformable_group
,
const
int
dilation_w
,
const
int
group
,
const
int
deformable_group
,
const
bool
with_bias
)
{
const
bool
with_bias
)
{
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
A
T_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
T
ORCH
_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
@@ -576,8 +576,8 @@ void modulated_deform_conv_cuda_backward(
...
@@ -576,8 +576,8 @@ void modulated_deform_conv_cuda_backward(
int
kernel_h
,
int
kernel_w
,
int
stride_h
,
int
stride_w
,
int
pad_h
,
int
kernel_h
,
int
kernel_w
,
int
stride_h
,
int
stride_w
,
int
pad_h
,
int
pad_w
,
int
dilation_h
,
int
dilation_w
,
int
group
,
int
deformable_group
,
int
pad_w
,
int
dilation_h
,
int
dilation_w
,
int
group
,
int
deformable_group
,
const
bool
with_bias
)
{
const
bool
with_bias
)
{
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
A
T_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
T
ORCH
_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
...
rodnet/ops/dcn/src/deform_conv_3d_cuda.cpp
View file @
66101bd4
...
@@ -71,26 +71,26 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -71,26 +71,26 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
at
::
Tensor
weight
,
int
kH
,
int
kW
,
int
kT
,
int
dH
,
int
dW
,
int
dT
,
at
::
Tensor
weight
,
int
kH
,
int
kW
,
int
kT
,
int
dH
,
int
dW
,
int
dT
,
int
padH
,
int
padW
,
int
padT
,
int
dilationH
,
int
dilationW
,
int
dilationT
,
int
padH
,
int
padW
,
int
padT
,
int
dilationH
,
int
dilationW
,
int
dilationT
,
int
group
,
int
deformable_group
)
{
int
group
,
int
deformable_group
)
{
A
T_CHECK
(
weight
.
ndimension
()
==
5
,
T
ORCH
_CHECK
(
weight
.
ndimension
()
==
5
,
"5D weight tensor (nOutputPlane,nInputPlane,kH,kW) expected, "
"5D weight tensor (nOutputPlane,nInputPlane,kH,kW) expected, "
"but got: %s"
,
"but got: %s"
,
weight
.
ndimension
());
weight
.
ndimension
());
A
T_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
T
ORCH
_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
A
T_CHECK
(
kW
>
0
&&
kH
>
0
&&
kT
>
0
,
T
ORCH
_CHECK
(
kW
>
0
&&
kH
>
0
&&
kT
>
0
,
"kernel size should be greater than zero, but got kH: %d kW: %d kT: %d"
,
kH
,
"kernel size should be greater than zero, but got kH: %d kW: %d kT: %d"
,
kH
,
kW
,
kT
);
kW
,
kT
);
A
T_CHECK
((
weight
.
size
(
2
)
==
kT
&&
weight
.
size
(
3
)
==
kH
&&
weight
.
size
(
4
)
==
kW
),
T
ORCH
_CHECK
((
weight
.
size
(
2
)
==
kT
&&
weight
.
size
(
3
)
==
kH
&&
weight
.
size
(
4
)
==
kW
),
"kernel size should be consistent with weight, "
,
"kernel size should be consistent with weight, "
,
"but got kH: %d kW: %d kT: %d weight.size(2): %d, weight.size(3): %d, weight.size(4): %d"
,
kH
,
"but got kH: %d kW: %d kT: %d weight.size(2): %d, weight.size(3): %d, weight.size(4): %d"
,
kH
,
kW
,
kT
,
weight
.
size
(
2
),
weight
.
size
(
3
),
weight
.
size
(
4
));
kW
,
kT
,
weight
.
size
(
2
),
weight
.
size
(
3
),
weight
.
size
(
4
));
A
T_CHECK
(
dW
>
0
&&
dH
>
0
&&
dT
>
0
,
T
ORCH
_CHECK
(
dW
>
0
&&
dH
>
0
&&
dT
>
0
,
"stride should be greater than zero, but got dH: %d dW: %d dT: %d"
,
dH
,
dW
,
dT
);
"stride should be greater than zero, but got dH: %d dW: %d dT: %d"
,
dH
,
dW
,
dT
);
A
T_CHECK
(
T
ORCH
_CHECK
(
dilationW
>
0
&&
dilationH
>
0
&&
dilationT
>
0
,
dilationW
>
0
&&
dilationH
>
0
&&
dilationT
>
0
,
"dilation should be greater than 0, but got dilationH: %d dilationW: %d dilationT: %d"
,
"dilation should be greater than 0, but got dilationH: %d dilationW: %d dilationT: %d"
,
dilationH
,
dilationW
,
dilationT
);
dilationH
,
dilationW
,
dilationT
);
...
@@ -108,7 +108,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -108,7 +108,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
dimw
++
;
dimw
++
;
}
}
A
T_CHECK
(
ndim
==
4
||
ndim
==
5
,
"4D or 5D input tensor expected but got: %s"
,
T
ORCH
_CHECK
(
ndim
==
4
||
ndim
==
5
,
"4D or 5D input tensor expected but got: %s"
,
ndim
);
ndim
);
long
nInputPlane
=
weight
.
size
(
1
)
*
group
;
long
nInputPlane
=
weight
.
size
(
1
)
*
group
;
...
@@ -123,7 +123,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -123,7 +123,7 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
long
outputTime
=
long
outputTime
=
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
A
T_CHECK
(
nInputPlane
%
deformable_group
==
0
,
T
ORCH
_CHECK
(
nInputPlane
%
deformable_group
==
0
,
"input channels must divide deformable group size"
);
"input channels must divide deformable group size"
);
if
(
outputWidth
<
1
||
outputHeight
<
1
)
if
(
outputWidth
<
1
||
outputHeight
<
1
)
...
@@ -133,27 +133,27 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
...
@@ -133,27 +133,27 @@ void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOutput,
nInputPlane
,
inputHeight
,
inputWidth
,
nOutputPlane
,
outputHeight
,
nInputPlane
,
inputHeight
,
inputWidth
,
nOutputPlane
,
outputHeight
,
outputWidth
);
outputWidth
);
A
T_CHECK
(
input
.
size
(
1
)
==
nInputPlane
,
T
ORCH
_CHECK
(
input
.
size
(
1
)
==
nInputPlane
,
"invalid number of input planes, expected: %d, but got: %d"
,
"invalid number of input planes, expected: %d, but got: %d"
,
nInputPlane
,
input
.
size
(
1
));
nInputPlane
,
input
.
size
(
1
));
A
T_CHECK
((
inputHeight
>=
kH
&&
inputWidth
>=
kW
&&
inputTime
>=
kT
),
T
ORCH
_CHECK
((
inputHeight
>=
kH
&&
inputWidth
>=
kW
&&
inputTime
>=
kT
),
"input data is smaller than kernel"
);
"input data is smaller than kernel"
);
A
T_CHECK
((
offset
.
size
(
2
)
==
outputTime
&&
offset
.
size
(
3
)
==
outputHeight
&&
offset
.
size
(
4
)
==
outputWidth
),
T
ORCH
_CHECK
((
offset
.
size
(
2
)
==
outputTime
&&
offset
.
size
(
3
)
==
outputHeight
&&
offset
.
size
(
4
)
==
outputWidth
),
"invalid spatial size of offset, expected time: %d height: %d width: %d, but "
"invalid spatial size of offset, expected time: %d height: %d width: %d, but "
"got time: %d height: %d width: %d"
,
"got time: %d height: %d width: %d"
,
outputTime
,
outputHeight
,
outputWidth
,
offset
.
size
(
2
),
offset
.
size
(
3
),
offset
.
size
(
4
));
outputTime
,
outputHeight
,
outputWidth
,
offset
.
size
(
2
),
offset
.
size
(
3
),
offset
.
size
(
4
));
A
T_CHECK
((
offset
.
size
(
1
)
==
deformable_group
*
2
*
kH
*
kW
*
kT
),
T
ORCH
_CHECK
((
offset
.
size
(
1
)
==
deformable_group
*
2
*
kH
*
kW
*
kT
),
"invalid number of channels of offset"
);
"invalid number of channels of offset"
);
if
(
gradOutput
!=
NULL
)
{
if
(
gradOutput
!=
NULL
)
{
A
T_CHECK
(
gradOutput
->
size
(
dimf
)
==
nOutputPlane
,
T
ORCH
_CHECK
(
gradOutput
->
size
(
dimf
)
==
nOutputPlane
,
"invalid number of gradOutput planes, expected: %d, but got: %d"
,
"invalid number of gradOutput planes, expected: %d, but got: %d"
,
nOutputPlane
,
gradOutput
->
size
(
dimf
));
nOutputPlane
,
gradOutput
->
size
(
dimf
));
A
T_CHECK
((
gradOutput
->
size
(
dimt
)
==
outputTime
&&
T
ORCH
_CHECK
((
gradOutput
->
size
(
dimt
)
==
outputTime
&&
gradOutput
->
size
(
dimh
)
==
outputHeight
&&
gradOutput
->
size
(
dimh
)
==
outputHeight
&&
gradOutput
->
size
(
dimw
)
==
outputWidth
),
gradOutput
->
size
(
dimw
)
==
outputWidth
),
"invalid size of gradOutput, expected time: %d height: %d width: %d, but "
"invalid size of gradOutput, expected time: %d height: %d width: %d, but "
...
@@ -214,7 +214,7 @@ int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight,
...
@@ -214,7 +214,7 @@ int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight,
long
outputTime
=
long
outputTime
=
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
A
T_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
T
ORCH
_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
output
=
output
.
view
({
batchSize
/
im2col_step
,
im2col_step
,
nOutputPlane
,
output
=
output
.
view
({
batchSize
/
im2col_step
,
im2col_step
,
nOutputPlane
,
outputTime
,
outputHeight
,
outputWidth
});
outputTime
,
outputHeight
,
outputWidth
});
...
@@ -341,7 +341,7 @@ int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset,
...
@@ -341,7 +341,7 @@ int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset,
long
outputTime
=
long
outputTime
=
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
A
T_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
3
,
"invalid batch size of offset"
);
T
ORCH
_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
3
,
"invalid batch size of offset"
);
gradInput
=
gradInput
.
view
({
batchSize
,
nInputPlane
,
inputTime
,
inputHeight
,
inputWidth
});
gradInput
=
gradInput
.
view
({
batchSize
,
nInputPlane
,
inputTime
,
inputHeight
,
inputWidth
});
columns
=
at
::
zeros
(
columns
=
at
::
zeros
(
{
nInputPlane
*
kW
*
kH
*
kT
,
im2col_step
*
outputTime
*
outputHeight
*
outputWidth
},
{
nInputPlane
*
kW
*
kH
*
kT
,
im2col_step
*
outputTime
*
outputHeight
*
outputWidth
},
...
@@ -463,7 +463,7 @@ int deform_conv_backward_parameters_cuda(
...
@@ -463,7 +463,7 @@ int deform_conv_backward_parameters_cuda(
long
outputTime
=
long
outputTime
=
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
(
inputTime
+
2
*
padT
-
(
dilationT
*
(
kT
-
1
)
+
1
))
/
dT
+
1
;
A
T_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
T
ORCH
_CHECK
((
offset
.
size
(
0
)
==
batchSize
),
"invalid batch size of offset"
);
columns
=
at
::
zeros
(
columns
=
at
::
zeros
(
{
nInputPlane
*
kW
*
kH
*
kT
,
im2col_step
*
outputHeight
*
outputWidth
*
outputTime
},
{
nInputPlane
*
kW
*
kH
*
kT
,
im2col_step
*
outputHeight
*
outputWidth
*
outputTime
},
...
@@ -543,8 +543,8 @@ void modulated_deform_conv_cuda_forward(
...
@@ -543,8 +543,8 @@ void modulated_deform_conv_cuda_forward(
const
int
pad_h
,
const
int
pad_w
,
const
int
dilation_h
,
const
int
pad_h
,
const
int
pad_w
,
const
int
dilation_h
,
const
int
dilation_w
,
const
int
group
,
const
int
deformable_group
,
const
int
dilation_w
,
const
int
group
,
const
int
deformable_group
,
const
bool
with_bias
)
{
const
bool
with_bias
)
{
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
A
T_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
T
ORCH
_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
@@ -625,8 +625,8 @@ void modulated_deform_conv_cuda_backward(
...
@@ -625,8 +625,8 @@ void modulated_deform_conv_cuda_backward(
int
kernel_h
,
int
kernel_w
,
int
stride_h
,
int
stride_w
,
int
pad_h
,
int
kernel_h
,
int
kernel_w
,
int
stride_h
,
int
stride_w
,
int
pad_h
,
int
pad_w
,
int
dilation_h
,
int
dilation_w
,
int
group
,
int
deformable_group
,
int
pad_w
,
int
dilation_h
,
int
dilation_w
,
int
group
,
int
deformable_group
,
const
bool
with_bias
)
{
const
bool
with_bias
)
{
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
A
T_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
T
ORCH
_CHECK
(
weight
.
is_contiguous
(),
"weight tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
...
rodnet/ops/dcn/src/deform_pool_2d_cuda.cpp
View file @
66101bd4
...
@@ -33,7 +33,7 @@ void deform_psroi_pooling_cuda_forward(
...
@@ -33,7 +33,7 @@ void deform_psroi_pooling_cuda_forward(
at
::
Tensor
top_count
,
const
int
no_trans
,
const
float
spatial_scale
,
at
::
Tensor
top_count
,
const
int
no_trans
,
const
float
spatial_scale
,
const
int
output_dim
,
const
int
group_size
,
const
int
pooled_size
,
const
int
output_dim
,
const
int
group_size
,
const
int
pooled_size
,
const
int
part_size
,
const
int
sample_per_part
,
const
float
trans_std
)
{
const
int
part_size
,
const
int
sample_per_part
,
const
float
trans_std
)
{
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
@@ -59,8 +59,8 @@ void deform_psroi_pooling_cuda_backward(
...
@@ -59,8 +59,8 @@ void deform_psroi_pooling_cuda_backward(
const
int
no_trans
,
const
float
spatial_scale
,
const
int
output_dim
,
const
int
no_trans
,
const
float
spatial_scale
,
const
int
output_dim
,
const
int
group_size
,
const
int
pooled_size
,
const
int
part_size
,
const
int
group_size
,
const
int
pooled_size
,
const
int
part_size
,
const
int
sample_per_part
,
const
float
trans_std
)
{
const
int
sample_per_part
,
const
float
trans_std
)
{
A
T_CHECK
(
out_grad
.
is_contiguous
(),
"out_grad tensor has to be contiguous"
);
T
ORCH
_CHECK
(
out_grad
.
is_contiguous
(),
"out_grad tensor has to be contiguous"
);
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
...
rodnet/ops/dcn/src/deform_pool_3d_cuda.cpp
View file @
66101bd4
...
@@ -33,7 +33,7 @@ void deform_psroi_pooling_cuda_forward(
...
@@ -33,7 +33,7 @@ void deform_psroi_pooling_cuda_forward(
at
::
Tensor
top_count
,
const
int
no_trans
,
const
float
spatial_scale
,
at
::
Tensor
top_count
,
const
int
no_trans
,
const
float
spatial_scale
,
const
int
output_dim
,
const
int
group_size
,
const
int
pooled_size
,
const
int
output_dim
,
const
int
group_size
,
const
int
pooled_size
,
const
int
part_size
,
const
int
sample_per_part
,
const
float
trans_std
)
{
const
int
part_size
,
const
int
sample_per_part
,
const
float
trans_std
)
{
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
@@ -59,8 +59,8 @@ void deform_psroi_pooling_cuda_backward(
...
@@ -59,8 +59,8 @@ void deform_psroi_pooling_cuda_backward(
const
int
no_trans
,
const
float
spatial_scale
,
const
int
output_dim
,
const
int
no_trans
,
const
float
spatial_scale
,
const
int
output_dim
,
const
int
group_size
,
const
int
pooled_size
,
const
int
part_size
,
const
int
group_size
,
const
int
pooled_size
,
const
int
part_size
,
const
int
sample_per_part
,
const
float
trans_std
)
{
const
int
sample_per_part
,
const
float
trans_std
)
{
A
T_CHECK
(
out_grad
.
is_contiguous
(),
"out_grad tensor has to be contiguous"
);
T
ORCH
_CHECK
(
out_grad
.
is_contiguous
(),
"out_grad tensor has to be contiguous"
);
A
T_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
T
ORCH
_CHECK
(
input
.
is_contiguous
(),
"input tensor has to be contiguous"
);
at
::
DeviceGuard
guard
(
input
.
device
());
at
::
DeviceGuard
guard
(
input
.
device
());
const
int
batch
=
input
.
size
(
0
);
const
int
batch
=
input
.
size
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment