SplitToSequence#

  • Domain: ai.onnx

  • Since version: 11

Split a tensor into a sequence of tensors, along the specified ‘axis’. Lengths of the parts can be specified using the optional argument ‘split’. If ‘split’ is not specified, ‘input’ is split into chunks of size 1 along the specified ‘axis’. ‘split’ must contain only positive numbers. ‘split’ is either a scalar (tensor of empty shape), or a 1-D tensor. If ‘split’ is a scalar, then ‘input’ will be split into chunks all of size ‘split’ if possible. The last chunk alone may be smaller than ‘split’ if the ‘input’ size along the given axis ‘axis’ is not divisible by ‘split’. If ‘split’ is a 1-dimensional tensor, the input tensor is split into ‘size(split)’ chunks, with lengths of the parts on ‘axis’ specified in ‘split’. In this scenario, the sum of entries in ‘split’ must be equal to the dimension size of input tensor on ‘axis’.

Inputs

  • input (T): The tensor to split

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

Outputs

  • output_sequence (S): One or more outputs forming a sequence of tensors after splitting

Type Constraints

  • T: Constrain input types to all tensor types. Allowed types: tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8).

  • I: Constrain split size to integral tensor. Allowed types: tensor(int32), tensor(int64).

  • S: Constrain output types to all tensor types. Allowed types: seq(tensor(bool)), seq(tensor(complex128)), seq(tensor(complex64)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)).