Slice

Description

Generates slices of the input tensor along multiple axes, and determines the position and size of each slice by using starts, ends, axes, and steps.

Input

  • data: tensor of type float16, float, double, int8, int16, int32, int64, uint8, uint16, uint32, uint64, or bool.
  • starts: 1D tensor of type int32 or int64, specifying the start position of the slice.
  • ends: 1D tensor of type int32 or int64, specifying the end position of the slice.
  • (Optional) axes: 1D tensor of type int32 or int64, specifying the axis for slicing.
  • (Optional) steps: 1D tensor of type int32 or int64, specifying the step for slicing.

Output

output: tensor of the identical data type as data.

Constraints

data: The input tensor dimension cannot be 1.

steps: The value of the last axis must be 1.

ONNX Opset Support

Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18