Skip to content

Commit c6a56c2

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Fix exporting issue (#239)
Summary: Pull Request resolved: #239 While Jarvis' CI was down for another issue, we need to propagate changes from D48917505 to the fix introduced concurrently in D48838464. Reviewed By: angelayi Differential Revision: D49070726 fbshipit-source-id: 55761c0237da8b142016e4cf3eea95929db42387
1 parent 1406fe8 commit c6a56c2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

exir/capture/_capture.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,17 @@ def _capture_legacy_do_not_use(f, args) -> ExirExportedProgram:
6565
_instantiate_missing_placeholder_val_with_real_inputs(graph_module, flat_args)
6666
graph_module._apply(torch.Tensor.contiguous)
6767

68+
user_inputs = [
69+
node.name for node in graph_module.graph.nodes if node.op == "placeholder"
70+
]
71+
output_node = list(graph_module.graph.nodes)[-1]
72+
assert output_node.op == "output"
73+
user_outputs = [arg.name for arg in output_node.args[0]]
74+
6875
ep = HackedUpExportedProgramDONOTUSE(
6976
graph_module,
7077
graph_module.graph,
71-
ExportGraphSignature([], [], [], [], {}, {}, {}, None),
78+
ExportGraphSignature([], [], user_inputs, user_outputs, {}, {}, {}, None),
7279
CallSpec(in_spec, out_spec),
7380
{},
7481
{},

0 commit comments

Comments
 (0)