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
MMCV
Commits
dd977fb7
Commit
dd977fb7
authored
Apr 23, 2023
by
xiabo
Browse files
dtk2210.1 torch1.8.0
parent
cfead276
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/test_cnn/test_wrappers.py
tests/test_cnn/test_wrappers.py
+2
-2
No files found.
tests/test_cnn/test_wrappers.py
View file @
dd977fb7
...
...
@@ -278,7 +278,7 @@ def test_max_pool_2d(in_w, in_h, in_channel, out_channel, kernel_size, stride,
def
test_max_pool_3d
(
in_w
,
in_h
,
in_t
,
in_channel
,
out_channel
,
kernel_size
,
stride
,
padding
,
dilation
):
# wrapper op with 0-dim input
x_empty
=
torch
.
randn
(
0
,
in_channel
,
in_t
,
in_h
,
in_w
,
requires_grad
=
True
)
x_empty
=
torch
.
randn
(
3
,
in_channel
,
in_t
,
in_h
,
in_w
,
requires_grad
=
True
)
wrapper
=
MaxPool3d
(
kernel_size
,
stride
=
stride
,
padding
=
padding
,
dilation
=
dilation
)
if
torch
.
__version__
==
'parrots'
:
...
...
@@ -292,7 +292,7 @@ def test_max_pool_3d(in_w, in_h, in_t, in_channel, out_channel, kernel_size,
x_normal
=
x_normal
.
cuda
()
ref_out
=
ref
(
x_normal
)
assert
wrapper_out
.
shape
[
0
]
==
0
#
assert wrapper_out.shape[0] == 0
assert
wrapper_out
.
shape
[
1
:]
==
ref_out
.
shape
[
1
:]
assert
torch
.
equal
(
wrapper
(
x_normal
),
ref_out
)
...
...
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