Skip to content

Allow module.forward() to return a dict#1239

Closed
dnouri wants to merge 1 commit intopytorch:masterfrom
dnouri:module-forward-return-dict
Closed

Allow module.forward() to return a dict#1239
dnouri wants to merge 1 commit intopytorch:masterfrom
dnouri:module-forward-return-dict

Conversation

@dnouri
Copy link

@dnouri dnouri commented Apr 12, 2017

Useful to be able to name variables you return in case there is a few
of them. Also a plus for maintainablity; that is, you can add
variables later without breaking every caller's code.

@dnouri dnouri changed the title Allow model.forward() to return a dict Allow module.forward() to return a dict Apr 12, 2017
Useful to be able to name variables you return in case there is a few
of them.  Also a plus for maintainablity; that is, you can add
variables later without breaking every caller's code.
@dnouri dnouri force-pushed the module-forward-return-dict branch from afb26a4 to 4960683 Compare April 12, 2017 05:13
@dnouri
Copy link
Author

dnouri commented Apr 12, 2017

I just discovered that this is a duplicate of #1205. Sorry for the noise.

I implemented one of the changes suggested in #1205, which was to hook all the outputs, instead of just the first element (in case of a list, previously).

@dnouri
Copy link
Author

dnouri commented Apr 12, 2017

Looks like we actually want to support list-of-lists as return values. Closing as duplicate.

@dnouri dnouri closed this Apr 12, 2017
jjsjann123 pushed a commit to jjsjann123/pytorch that referenced this pull request Nov 5, 2021
Project persistent buffers integration (pytorch#1238)
Add warp padding to normalization and reduction schedulers (pytorch#1239)
Aggressively go after 3D scheduling in normalization and reductions. (pytorch#1240)
Fix sorting for reduction schedulers... again. (pytorch#1241)
hubertlu-tw pushed a commit to hubertlu-tw/pytorch that referenced this pull request Nov 1, 2022
* pass `self.mask_additive`

* clang-format

* removing THCState
hubertlu-tw pushed a commit to hubertlu-tw/pytorch that referenced this pull request Nov 1, 2022
* pass `self.mask_additive`

* clang-format

* removing THCState
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.

2 participants