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
2bb1160e
Unverified
Commit
2bb1160e
authored
Sep 25, 2020
by
Wenwei Zhang
Committed by
GitHub
Sep 25, 2020
Browse files
[fix]: fix wrapper comparison of pytorch version (#572)
parent
afb73995
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mmcv/cnn/bricks/wrappers.py
mmcv/cnn/bricks/wrappers.py
+2
-2
No files found.
mmcv/cnn/bricks/wrappers.py
View file @
2bb1160e
...
...
@@ -30,7 +30,7 @@ class NewEmptyTensorOp(torch.autograd.Function):
class
Conv2d
(
nn
.
Conv2d
):
def
forward
(
self
,
x
):
if
x
.
numel
()
==
0
and
torch
.
__version__
<=
'1.4'
:
if
x
.
numel
()
==
0
and
torch
.
__version__
<=
'1.4
.0
'
:
out_shape
=
[
x
.
shape
[
0
],
self
.
out_channels
]
for
i
,
k
,
p
,
s
,
d
in
zip
(
x
.
shape
[
-
2
:],
self
.
kernel_size
,
self
.
padding
,
self
.
stride
,
self
.
dilation
):
...
...
@@ -72,7 +72,7 @@ class MaxPool2d(nn.MaxPool2d):
def
forward
(
self
,
x
):
# PyTorch 1.6 does not support empty tensor inference yet
if
x
.
numel
()
==
0
and
torch
.
__version__
<=
'1.6'
:
if
x
.
numel
()
==
0
and
torch
.
__version__
<=
'1.6
.0
'
:
out_shape
=
list
(
x
.
shape
[:
2
])
for
i
,
k
,
p
,
s
,
d
in
zip
(
x
.
shape
[
-
2
:],
_pair
(
self
.
kernel_size
),
_pair
(
self
.
padding
),
_pair
(
self
.
stride
),
...
...
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