Skip to content

Commit a7ac3d5

Browse files
aorenstefacebook-github-bot
authored andcommitted
Add pyre-ignore to fix executorch for D59723984 (#4260)
Summary: Pull Request resolved: #4260 D59723984 improves some typing for pytorch proxy_tensor - but it causes executorch to get some minor type errors. This should allow the subsequent diffs to pass. Reviewed By: oulgen Differential Revision: D59726906 fbshipit-source-id: 9d2a6909c1e478b145a8bcc7c9c6b6ab31964767
1 parent fbe0af1 commit a7ac3d5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

exir/capture/_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def capture( # noqa: C901
215215
ep = _transform(ep, ReplaceViewOpsWithViewCopyOpsPass())
216216
if not config._unlift:
217217
return ExirExportedProgram(ep, False)
218-
graph_module = ep.module()
218+
graph_module = cast(torch.fx.GraphModule, ep.module())
219219

220220
elif config.enable_dynamic_shape:
221221
graph_module, _ = dynamo_trace(

exir/delegate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from __future__ import annotations
1010

11-
from typing import Any
11+
from typing import Any, cast
1212

1313
import torch
1414
import torch.utils._pytree as pytree
@@ -38,7 +38,9 @@ def trace_call_delegate(proxy_mode, func_overload, lowered_module, *args):
3838
def _unwrap_proxy(e):
3939
if not isinstance(e, (torch.Tensor, torch.SymInt, torch.SymFloat)):
4040
return e
41-
return get_proxy_slot(e, proxy_mode.tracer, e, lambda e: e.proxy)
41+
return get_proxy_slot(
42+
cast(torch.Tensor, e), proxy_mode.tracer, e, lambda e: e.proxy
43+
)
4244

4345
if not is_lowered_module(lowered_module):
4446
raise ValueError(

0 commit comments

Comments
 (0)