Skip to content

Conversation

@dalegebit
Copy link

Returning a dict or instances of custom classes can be very helpful, especially for complex networks. For exmaple, the RNN state of a complex RNN model is usually wrapped inside a custom class.

return type(out)(map(gather_map, zip(*outputs)))
if isinstance(out, dict):
return dict(zip(out.keys(),
map(gather_map, zip(*[d.values() for d in outputs]))))

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@weiyangfb weiyangfb added the awaiting response (this tag is deprecated) This tag is deprecated while we figure out what to do with it label Aug 15, 2018
@weiyangfb
Copy link
Contributor

closing this because similar PR is already merged: #6113

@weiyangfb weiyangfb closed this Aug 15, 2018
@weiyangfb weiyangfb removed the awaiting response (this tag is deprecated) This tag is deprecated while we figure out what to do with it label Aug 15, 2018
samnordmann pushed a commit to samnordmann/pytorch that referenced this pull request Mar 6, 2023
* Add prod op

* Accept None/scalar dims argument in reduction ops.

These are actually the only signatures accepted by the pytorch
prod/min/max functions.

* Add optional dtype argument to oneVal and zeroVal

---------

Co-authored-by: Jacob Hinkle <jhinkle@nvidia.com>
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.

5 participants