class
AirStridedSliceOptions
PythonOptions for STRIDEDSLICE operator.
AirStridedSliceOptions()Options for STRIDED_SLICE operator.
attribute
begin
Pythonbegin: tuple[int, int, int, int] = Field(..., description='Begin indices for each dimension')Begin indices for each dimension.
attribute
end
Pythonend: tuple[int, int, int, int] = Field(..., description='End indices for each dimension')End indices for each dimension.
attribute
stride
Pythonstride: tuple[int, int, int, int] = Field(..., description='Stride values for each dimension')Stride values for each dimension.
attribute
begin_mask
Pythonbegin_mask: int = Field(0, description='Mask for begin indices')Mask for begin indices (default 0).
attribute
end_mask
Pythonend_mask: int = Field(0, description='Mask for end indices')Mask for end indices (default 0).
attribute
ellipsis_mask
Pythonellipsis_mask: int = Field(0, description='Mask for ellipsis')Mask for ellipsis (default 0).
attribute
new_axis_mask
Pythonnew_axis_mask: int = Field(0, description='Mask for new axes')Mask for new axes (default 0).
attribute
shrink_axis_mask
Pythonshrink_axis_mask: int = Field(0, description='Mask for shrink axes')Mask for shrink axes (default 0).
attribute
offset
Pythonoffset: bool = Field(False, description='If True, apply offset to the begin and end indices')If True, apply offset to the begin and end indices (default False).
method
get_slices
PythonCompute (begin, end, stride) for each axis, padding dims and shape to padto dims.
get_slices(input_shape: tuple[int, ...], pad_to: int = 4) -> list[AirStrideSlice]Compute (begin, end, stride) for each axis, padding dims and shape to pad_to dims.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
input_shape | tuple[int, ...] | Required | The shape of the input tensor. |
pad_to | int | 4 | The number of dimensions to pad the input shape to (default 4). |
Returns
| Type | Description |
|---|---|
list[AirStrideSlice] | A list of AirStrideSlice, each containing (begin, end, stride) for each axis. |