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: atalman
Differential Revision: D111351451
fbshipit-source-id: de9db03eb939df7be52bd1b0212aa80bd495e949
Author
generatedunixname499836121