Skip to content

Commit

Permalink
Handle axes=None for apply_slice when opset < 10 (#50)
Browse files Browse the repository at this point in the history
* Fixes #17, update clip operator (#18)

* Fixes #17, update clip operator (updated in ONNX 11)
* handle min or max = None

* Handle axes=None for apply_slice when opset < 10

Co-authored-by: Xavier Dupré <[email protected]>
  • Loading branch information
jiafatom and xadupre authored Jan 30, 2020
1 parent e87c572 commit e42677e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions onnxconverter_common/onnx_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,12 @@ def apply_slice(scope, input_name, output_name, container, starts, ends,
name = _create_name_or_use_existing_one(scope, 'Slice', operator_name)

if container.target_opset < 10:
container.add_node('Slice', input_name, output_name, name=name,
starts=starts, ends=ends, axes=axes, op_version=1)
if axes is None:
container.add_node('Slice', input_name, output_name, name=name,
starts=starts, ends=ends, op_version=1)
else:
container.add_node('Slice', input_name, output_name, name=name,
starts=starts, ends=ends, axes=axes, op_version=1)
else:
if container.target_opset == 10:
op_version = 10
Expand Down

0 comments on commit e42677e

Please sign in to comment.