mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
PT2/TorchScript interoperability fix (#94678)
Allows torch.compile() to inline into ScriptFunction Pull Request resolved: https://github.com/pytorch/pytorch/pull/94678 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
b6443fca86
commit
ae57bd6630
@ -1343,6 +1343,8 @@ def script(obj, optimize=None, _frames_up=0, _rcb=None,
|
||||
)
|
||||
# Forward docstrings
|
||||
fn.__doc__ = obj.__doc__
|
||||
# Allow torch.compile() to inline
|
||||
fn._torchdynamo_inline = obj # type: ignore[attr-defined]
|
||||
_set_jit_function_cache(obj, fn)
|
||||
return fn
|
||||
else:
|
||||
|
Reference in New Issue
Block a user