pytorch
8e3c0210 - extend torch.jit._overload to module methods (#24259)

Commit
5 years ago
extend torch.jit._overload to module methods (#24259) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/24259 Follow up to https://github.com/pytorch/pytorch/pull/23886, add the same overload api specified in PEP 484 to module methods to reduce the friction of adding method overloads that was brought up in #23266. The usage is: ``` torch.jit.overload def add(self, y: int) -> int: ... torch.jit.overload def add(self, y: float) -> float: ... def add(): ... ``` Test Plan: Imported from OSS Differential Revision: D16921304 Pulled By: eellison fbshipit-source-id: 784e2f26f7ca9a330a434a603c86b53725c3dc71
Author
Elias Ellison
Parents
Loading