Skip to content

Commit b49bded

Browse files
Fix bug where unknown shape overwrites loop iter and cond shapes (#1382)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent 18793bf commit b49bded

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tf2onnx/tflite_handlers/tfl_controlflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def wire_tfl_while_body(g, loop_node_inputs, output_shapes,
114114
# in onnx the body inputs are: index, cond, [loop_vars]
115115
g.inputs = [iter_node, cond_node] + g.inputs
116116

117-
for p, c in zip(loop_node_inputs, g.input_names):
117+
# Shapes of iteration and cond are already known
118+
for p, c in zip(loop_node_inputs[2:], g.input_names[2:]):
118119
shape = p.output_shapes[0]
119120
g.set_shape(c, shape)
120121

0 commit comments

Comments
 (0)