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
apex
Commits
64f3d362
Unverified
Commit
64f3d362
authored
Nov 14, 2018
by
mcarilli
Committed by
GitHub
Nov 14, 2018
Browse files
Distributed backend compatibility update
parent
2b8277e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
apex/parallel/distributed.py
apex/parallel/distributed.py
+7
-3
No files found.
apex/parallel/distributed.py
View file @
64f3d362
...
...
@@ -157,10 +157,14 @@ class DistributedDataParallel(Module):
super
(
DistributedDataParallel
,
self
).
__init__
()
# Backward/forward compatibility around
# https://github.com/pytorch/pytorch/commit/540ef9b1fc5506369a48491af8a285a686689b36
if
(
hasattr
(
dist
,
"get_backend"
)):
# https://github.com/pytorch/pytorch/commit/540ef9b1fc5506369a48491af8a285a686689b36 and
# https://github.com/pytorch/pytorch/commit/044d00516ccd6572c0d6ab6d54587155b02a3b86
if
hasattr
(
dist
,
"get_backend"
):
self
.
_backend
=
dist
.
get_backend
()
self
.
backend_enum_holder
=
dist
.
DistBackend
if
hasattr
(
dist
,
"DistBackend"
):
self
.
backend_enum_holder
=
dist
.
DistBackend
else
:
self
.
backend_enum_holder
=
dist
.
Backend
else
:
self
.
_backend
=
dist
.
_backend
self
.
backend_enum_holder
=
dist
.
dist_backend
...
...
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