Skip to content

Commit 0550cfb

Browse files
author
root
committed
Update on "extend torch.jit._overload to module methods"
Follow up to #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(): ... ``` Differential Revision: [D16921304](https://our.internmc.facebook.com/intern/diff/D16921304)
1 parent c7454d5 commit 0550cfb

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

torch/jit/_recursive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def recursive_script(mod, exclude_methods=()):
156156
# we shouldn't directly compile overloaded methods, just its overloads
157157
def ignore_overloaded(method_name):
158158
return method_name not in overload_name_mappings
159-
>>>>>>> extend torch.jit._overload to modules
160159

161160
def make_stub(method):
162161
func = get_function_from_type(type(mod), method)

0 commit comments

Comments
 (0)