Skip to content

Conversation

@mseitzer
Copy link
Contributor

This change allows to use modules which return dictionaries with DataParallel.
Fixes #2992.

This is my first PR, please tell me if violated any standards.

@ssnl
Copy link
Collaborator

ssnl commented Mar 29, 2018

@pytorchbot test this please

if out is None:
return None
if isinstance(out, dict):
values = (item.values() for item in outputs)

This comment was marked as off-topic.

This comment was marked as off-topic.

@ssnl
Copy link
Collaborator

ssnl commented Mar 30, 2018

The new commit LGTM. Maybe @apaszke wants to take an extra look

@ezyang
Copy link
Contributor

ezyang commented Mar 30, 2018

@pytorchbot test this please

return None
if isinstance(out, dict):
return type(out)(((k, gather_map([d[k] for d in outputs]))
for k in out))

This comment was marked as off-topic.

@ezyang
Copy link
Contributor

ezyang commented Apr 2, 2018

@pytorchbot test this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataParallel Gather works only with iterable outputs

4 participants