File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,9 @@ def _get_new_signature(
436
436
)
437
437
)
438
438
if node .op == "output" :
439
- for output in node .all_input_nodes :
439
+ for output in pytree .tree_leaves ((node .args , node .kwargs )):
440
+ if not isinstance (output , torch .fx .Node ):
441
+ continue
440
442
output_specs .append (
441
443
OutputSpec (
442
444
kind = OutputKind .USER_OUTPUT ,
Original file line number Diff line number Diff line change @@ -61,9 +61,10 @@ def _get_updated_graph_signature(
61
61
Update the graph signature's user_input/user_outputs.
62
62
"""
63
63
new_input_specs = []
64
- for i , node in enumerate (new_gm .graph .nodes ):
64
+ i = 0
65
+ for node in new_gm .graph .nodes :
65
66
if node .op != "placeholder" :
66
- break
67
+ continue
67
68
68
69
assert i < len (
69
70
old_signature .input_specs
@@ -77,6 +78,7 @@ def _get_updated_graph_signature(
77
78
new_input_specs .append (
78
79
InputSpec (old_input_spec .kind , arg , old_input_spec .target )
79
80
)
81
+ i += 1
80
82
81
83
output_node = list (new_gm .graph .nodes )[- 1 ]
82
84
assert output_node .op == "output"
You can’t perform that action at this time.
0 commit comments