Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slice op: 'starts' and 'ends' values resulted in a negative dimension #28

Closed
pengwa opened this issue Nov 26, 2018 · 1 comment
Closed
Assignees

Comments

@pengwa
Copy link
Contributor

pengwa commented Nov 26, 2018

sometime slice need -1 in starts or ends, onnx doc actually allow https://github.com/onnx/onnx/blob/master/docs/Changelog.md#slice-1

starts and ends attributes to specify the start and end dimension for each axis in the list of axes, it uses this information to slice the input data tensor. If a negative value is passed for any of the start or end indices, it represent number of elements before the end of that dimension.

So I think this is a bug. This is blocking a real model conversion, could anybody familiar with this take a look? Thanks a lot.

@skottmckay skottmckay self-assigned this Nov 26, 2018
@pengwa
Copy link
Contributor Author

pengwa commented Nov 27, 2018

@skottmckay helped clarify why my case wrong.

basically, I am using starts = [-1], ends=[0].

in original tf.stride_sclice, this is allowed since another parameter stride=[1].

in onnx, -1 will become a concrete valid positive numb before running. ends will not. So I got this error.

seems not a bug, more likely I am using in an inproper way. closing this.

thanks for the investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants