Skip to content

Commit 3ab9fa1

Browse files
Merge pull request #1125 from onnx/tom/FixUnpackShape
Fixed error in computing shape of unpack op
2 parents b53f1bb + 9512641 commit 3ab9fa1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tf2onnx/onnx_opset/tensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,8 @@ def version_1(cls, ctx, node, **kwargs):
10861086
# split node is 1 rank higher than squeeze nodes
10871087
output_shape = ctx.get_shape(node.output[0])
10881088
if output_shape:
1089-
ctx.set_shape(node.output[0], output_shape.insert(axis, 1))
1089+
split_shape = output_shape[:axis] + [1] + output_shape[axis:]
1090+
ctx.set_shape(node.output[0], split_shape)
10901091

10911092

10921093
@tf_op("OneHot")

0 commit comments

Comments
 (0)