Skip to content

Commit

Permalink
[dynamo] fix potentially missing _torchdynamo_inline from ScriptFunct…
Browse files Browse the repository at this point in the history
…ion (pytorch#125447)

Fix pytorch#119747

Pull Request resolved: pytorch#125447
Approved by: https://github.com/jansel
  • Loading branch information
williamwen42 authored and pytorchmergebot committed May 6, 2024
1 parent ad9a27f commit bdaa7bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 0 deletions.
Empty file.
1 change: 1 addition & 0 deletions torch/jit/_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,7 @@ def forward(self, a) -> MyModule:
_check_directly_compile_overloaded(obj)
maybe_already_compiled_fn = _try_get_jit_cached_function(obj)
if maybe_already_compiled_fn:
maybe_already_compiled_fn._torchdynamo_inline = obj # type: ignore[attr-defined]
return maybe_already_compiled_fn
ast = get_jit_def(obj, obj.__name__)
if _rcb is None:
Expand Down

0 comments on commit bdaa7bb

Please sign in to comment.