Skip to content

Commit e29e418

Browse files
committed
tf shape attr.ints is not always "list"
1 parent 571f977 commit e29e418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tf2onnx/shape_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def infer_shape_for_node(g, node):
7070
shape_attr = node.get_attr("shape")
7171
new_shape = None
7272
if shape_attr.type == onnx_pb.TensorProto.INT32:
73-
new_shape = shape_attr.ints
73+
new_shape = list(shape_attr.ints)
7474
elif shape_attr.type == onnx_pb.TensorProto.FLOAT:
7575
# for scalar placeholder, it's type is float
76-
val = shape_attr.floats
76+
val = list(shape_attr.floats)
7777
if val:
7878
raise ValueError("placeholder shape has floats value, and not scalar value")
7979
else:

0 commit comments

Comments
 (0)