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
57f3a614
Unverified
Commit
57f3a614
authored
Mar 11, 2021
by
ZhangShilong
Committed by
GitHub
Mar 11, 2021
Browse files
fix scatter in pytorch18 (#882)
* fix scatter in pytorch18 * remove blanks
parent
6fc6f75a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
mmcv/parallel/distributed.py
mmcv/parallel/distributed.py
+5
-0
No files found.
mmcv/parallel/distributed.py
View file @
57f3a614
...
...
@@ -18,6 +18,11 @@ class MMDistributedDataParallel(DistributedDataParallel):
- It implement two APIs ``train_step()`` and ``val_step()``.
"""
def
to_kwargs
(
self
,
inputs
,
kwargs
,
device_id
):
# Use `self.to_kwargs` instead of `self.scatter` in pytorch1.8
# to move all tensors to device_id
return
scatter_kwargs
(
inputs
,
kwargs
,
[
device_id
],
dim
=
self
.
dim
)
def
scatter
(
self
,
inputs
,
kwargs
,
device_ids
):
return
scatter_kwargs
(
inputs
,
kwargs
,
device_ids
,
dim
=
self
.
dim
)
...
...
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