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
vision
Commits
fbd69f10
Unverified
Commit
fbd69f10
authored
Sep 06, 2021
by
Francisco Massa
Committed by
GitHub
Sep 06, 2021
Browse files
Make StochasticDepth FX-compatible (#4373)
parent
72d650ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
test/test_backbone_utils.py
test/test_backbone_utils.py
+1
-1
torchvision/ops/stochastic_depth.py
torchvision/ops/stochastic_depth.py
+4
-0
No files found.
test/test_backbone_utils.py
View file @
fbd69f10
...
...
@@ -39,7 +39,7 @@ class TestFxFeatureExtraction:
'num_classes'
:
1
,
'pretrained'
:
False
}
leaf_modules
=
[
torchvision
.
ops
.
StochasticDepth
]
leaf_modules
=
[]
def
_create_feature_extractor
(
self
,
*
args
,
**
kwargs
):
"""
...
...
torchvision/ops/stochastic_depth.py
View file @
fbd69f10
import
torch
import
torch.fx
from
torch
import
nn
,
Tensor
...
...
@@ -37,6 +38,9 @@ def stochastic_depth(input: Tensor, p: float, mode: str, training: bool = True)
return
input
*
noise
torch
.
fx
.
wrap
(
'stochastic_depth'
)
class
StochasticDepth
(
nn
.
Module
):
"""
See :func:`stochastic_depth`.
...
...
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