[doc] add example multiprocess code#16345
Conversation
|
|
||
| p.join() | ||
|
|
||
| `q` and `e` are used to coordinate between sender and receiver processes. |
There was a problem hiding this comment.
I think it would be clearer here if we briefly explained why we need the e before diving into the mechanics. We could also make this even more explicit in the code by deleting s_sample when the wait comes back.
The other subtlety, which I recall you telling me about, is that you have to actually delete the tensor, it's not enough to not use it anymore. That's also worth explicitly calling out here.
|
@ezyang another review on this? :D |
|
Thanks @ezyang ! |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: fixes #16141 Differential Revision: D13868539 Pulled By: ailzhang fbshipit-source-id: 03e858d0aff7804c5e9e03a8666f42fd12836ef2
|
This is already landed on master. Closing. |
Summary: fixes pytorch#16141 Differential Revision: D13868539 Pulled By: ailzhang fbshipit-source-id: 03e858d0aff7804c5e9e03a8666f42fd12836ef2
fixes #16141
cc: @ezyang @colesbury