onnx icon indicating copy to clipboard operation
onnx copied to clipboard

Why does SplitToSequence not allow zeros in `split` input?

Open ArchRobison opened this issue 1 year ago • 1 comments

Question

The ONNX 1.18.0 documentation says that for operator SplitToSequence:

‘split’ must contain only positive numbers. 

Why are zeros not allowed? The semantics for zeros seems unambiguous, and it seems like they should be allowed per the principle of least surprise.

ArchRobison avatar Sep 09 '24 16:09 ArchRobison

@gramalingam

justinchuby avatar Sep 09 '24 21:09 justinchuby

SplitToSequence does allow zeros in the split input. The documentation later says:

Length of each output. It can be either a scalar(tensor of empty shape), or a 1-D tensor. All values must be >= 0.

So the phrase "positive numbers" was presumably intended to include zero. The data type is tensor(int32) or tensor(int64) so the qualification is needed because those data types allow negative numbers.

robertknight avatar Sep 12 '25 12:09 robertknight