strided_slice
Classes
StridedSliceOperator
StridedSliceOperator(ident: int, op: OperatorT, model: ModelT, subgraph: SubGraphT, prefix: str = 'aot', attributes: dict[str, str] = {})
STRIDED_SLICE operator.
This operator performs a strided slice operation on the input tensor according to the specified parameters.
Parameters:
-
ident
int
) –Operator identifier.
-
op
OperatorT
) –Operator object from LiteRT model.
-
model
ModelT
) –LiteRT model object.
-
subgraph
SubGraphT
) –Subgraph object from LiteRT model.
-
prefix
str
, default:'aot'
) –Prefix for generated files. Defaults to "aot".
-
attributes
dict[str, str]
, default:{}
) –Attributes for template values. Defaults to {}.
Attributes
Functions
compute_values
generate_source_code
Generate the source code for the operator.
Parameters:
-
save_path
Path
) –Path to save the generated code.
Functions
compute_start_for_dim
Compute the start index for a given dimension.
Parameters:
-
axis
int
) –The axis along which to compute the start.
-
axis_size
int
) –The size of the axis.
-
stride
int
) –The stride value.
-
begin_mask
int
) –The begin mask.
-
start
int
) –The initial start index.
Returns:
-
int
(int
) –The computed start index.
compute_end_for_dim
compute_end_for_dim(axis: int, axis_size: int, stride: int, end_mask: int, start: int, end: int, shrink_axis_mask: int, offset: bool) -> int
Compute the end index for a given dimension.
Parameters:
-
axis
int
) –The axis along which to compute the end.
-
axis_size
int
) –The size of the axis.
-
stride
int
) –The stride value.
-
end_mask
int
) –The end mask.
-
start
int
) –The initial start index.
-
end
int
) –The initial end index.
-
shrink_axis_mask
int
) –The shrink axis mask.
-
offset
bool
) –Whether to apply an offset to the end index.
Returns:
-
int
(int
) –The computed end index.