Skip to content

Commit bbd3972

Browse files
author
wayuanho
committed
add some checks
1 parent ce08477 commit bbd3972

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tf2onnx/tfonnx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,13 @@ def concatv2_op(ctx, node, name, args):
777777
raise RuntimeError("all inputs of {} are empty".format(name))
778778

779779
axis_node = node.inputs[-1]
780+
utils.make_sure(axis_node.is_const(), "{} needs to be const".format(axis_node.name))
780781
axis_val = axis_node.get_tensor_value()
781782
ctx.remove_input(node, node.input[-1])
782783

783784
if axis_val < 0: # onnxruntime does not support -1 axis, but TF supports.
784785
input_shape = ctx.get_shape(node.input[0])
786+
utils.make_sure(input_shape is not None, "shape of {} is None".format(node.input[0]))
785787
axis_val = len(input_shape) + axis_val
786788
node.set_attr("axis", axis_val)
787789

0 commit comments

Comments
 (0)