Refactor generator methods (#187690)
Summary:
Refactor `.close`, `.send` and `.throw` to follow CPython semantics.
X-link: https://github.com/pytorch/pytorch/pull/187690
Approved by: https://github.com/rtimpe
Reviewed By: jeanschmidt
Differential Revision: D111722899
fbshipit-source-id: fe835264b63ddab27e86a65686d11aedf3021584
Author
generatedunixname499836121