mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Skip frame if the graph is empty (#105228)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105228 Approved by: https://github.com/anijain2305
This commit is contained in:
parent
0af287cef2
commit
d623f22b8b
|
|
@ -477,6 +477,16 @@ def _compile(
|
|||
)
|
||||
|
||||
assert output is not None
|
||||
|
||||
# Skipping Dynamo on a frame without any extracted graph.
|
||||
# This does not affect eager functionality. But this is necessary
|
||||
# for export for cases where Dynamo-reconstructed bytecode can create
|
||||
# new function frames, confusing export in thinking that there
|
||||
# are extra graphs now.
|
||||
|
||||
if output.export and output.is_empty_graph():
|
||||
return None
|
||||
|
||||
assert output.guards is not None
|
||||
CleanupManager.instance[out_code] = output.cleanups
|
||||
check_fn = CheckFunctionManager(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user