Skip to content

Commit f83f99d

Browse files
angelayifacebook-github-bot
authored andcommitted
Fix fake mode detection
Differential Revision: D87577206
1 parent b4d72f1 commit f83f99d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

exir/program/_program.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
from torch.fx._compatibility import compatibility
9898
from torch.fx.passes.infra.pass_manager import PassManager
9999
from torch.utils import _pytree as pytree
100+
from torch._export.utils import _detect_fake_mode_from_gm
100101

101102
Val = Any
102103

@@ -333,7 +334,8 @@ def lift_constant_tensor_pass(ep):
333334
graph_signature = ep.graph_signature
334335
buffers = list(graph_signature.buffers)
335336

336-
fake_mode = list(ep.graph.nodes)[0].meta["val"].fake_mode
337+
fake_mode = _detect_fake_mode_from_gm(ep.graph_module)
338+
337339
first_user_input = None
338340
lifted_constants = []
339341
for node in ep.graph.nodes:

0 commit comments

Comments
 (0)