Skip to content

Commit 281ca0c

Browse files
committed
Update on "[standalone_compile] Fix single Tensor outputs from split_module"
We assumed that the output in an FX graph would always just be a list[Tensor], even in the single tensor return case. It is possible for the output to be a single Tensor. This can happen by calling torch.fx.split_module on the module. Test Plan: - new test cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov [ghstack-poisoned]
1 parent da101fe commit 281ca0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

torch/_inductor/standalone_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def standalone_compile(
214214
assert last_node.op == "output"
215215
assert len(last_node.args) == 1
216216

217-
def handle_node(node):
217+
def handle_node(node: torch.fx.Node) -> None:
218218
nonlocal fake_mode
219219
if "example_value" in node.meta:
220220
maybe_tensor = node.meta["example_value"]

0 commit comments

Comments
 (0)