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: D110803133
fbshipit-source-id: a5829373cc535ea54d42931bca3429b7099662bf
Author
generatedunixname499836121