Skip to content

Commit

Permalink
Handle case input_name is list for apply_reshape (#35)
Browse files Browse the repository at this point in the history
* Handle case input_name is list for apply_reshape
  • Loading branch information
jiafatom authored Nov 18, 2019
1 parent 511a071 commit b9700d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion onnxconverter_common/onnx_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,11 @@ def apply_reshape(scope, input_name, output_name, container, operator_name=None,
container.add_initializer(desired_shape_name, onnx_proto.TensorProto.INT64, [len(desired_shape)], desired_shape)

# Create ONNX Reshape operator
container.add_node('Reshape', [input_name, desired_shape_name], output_name, op_version=5, name=name)
if isinstance(input_name, list):
input_name.append(desired_shape_name)
else:
input_name = [input_name, desired_shape_name]
container.add_node('Reshape', input_name, output_name, op_version=5, name=name)


def apply_resize(scope, input_name, output_name, container, operator_name=None, mode='nearest', scales=None):
Expand Down

0 comments on commit b9700d1

Please sign in to comment.