23.05
|
Functions | |
int | calculate_stride_on_index (int index, Coordinates strides) |
Computes stride of a given index. More... | |
int | calculate_start_on_index (TensorShape input_shape, int index, Coordinates starts, Coordinates strides, int32_t begin_mask) |
Computes absolute start position of a given index for a strided slice operation. More... | |
int | calculate_end_on_index (TensorShape input_shape, int index, int start_on_index, Coordinates ends, Coordinates strides, int32_t end_mask=0, int32_t shrink_axis_mask=0) |
Returns the absolute end position of a given index for a strided slice operation. More... | |
std::tuple< Coordinates, Coordinates, Coordinates > | calculate_strided_slice_coords (TensorShape input_shape, Coordinates starts, Coordinates ends, Coordinates strides, int32_t begin_mask=0, int32_t end_mask=0, int32_t shrink_axis_mask=0) |
Calculate start, end and stride coordinates for a strided slice. More... | |
TensorShape | compute_strided_slice_output_shape (TensorShape input_shape, Coordinates starts, Coordinates ends, Coordinates strides, int32_t begin_mask=0, int32_t end_mask=0, int32_t shrink_axis_mask=0, bool return_unshrinked=false) |
Computes output shape of strided slice. More... | |
int32_t | construct_slice_end_mask (Coordinates ends) |
Constructs end mask in case we want to perform a slice operation using the strided slice interface. More... | |
int calculate_end_on_index | ( | TensorShape | input_shape, |
int | index, | ||
int | start_on_index, | ||
Coordinates | ends, | ||
Coordinates | strides, | ||
int32_t | end_mask = 0 , |
||
int32_t | shrink_axis_mask = 0 |
||
) |
Returns the absolute end position of a given index for a strided slice operation.
[in] | input_shape | Input tensor shape |
[in] | index | Index of tensor to calculate absolute start position |
[in] | start_on_index | Absolute start coordinate for given index |
[in] | ends | End coordinates |
[in] | strides | Slice strides |
[in] | end_mask | (Optional) If the ith bit of end_mask is set, end[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | shrink_axis_mask | (Optional) If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved. |
Definition at line 72 of file tensor_transform.cpp.
References calculate_stride_on_index(), arm_compute::utility::clamp(), arm_compute::helpers::bit_ops::is_bit_set(), arm_compute::support::cpp11::lowest(), and Dimensions< T >::num_dimensions().
Referenced by calculate_strided_slice_coords(), and compute_strided_slice_output_shape().
int calculate_start_on_index | ( | TensorShape | input_shape, |
int | index, | ||
Coordinates | starts, | ||
Coordinates | strides, | ||
int32_t | begin_mask | ||
) |
Computes absolute start position of a given index for a strided slice operation.
[in] | input_shape | Input tensor shape |
[in] | index | Index of tensor to calculate absolute start position |
[in] | starts | Start coordinates |
[in] | strides | Slice strides |
[in] | begin_mask | (Optional) If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead. |
Definition at line 39 of file tensor_transform.cpp.
References calculate_stride_on_index(), arm_compute::utility::clamp(), arm_compute::helpers::bit_ops::is_bit_set(), arm_compute::support::cpp11::lowest(), and Dimensions< T >::num_dimensions().
Referenced by calculate_strided_slice_coords(), and compute_strided_slice_output_shape().
int calculate_stride_on_index | ( | int | index, |
Coordinates | strides | ||
) |
Computes stride of a given index.
[in] | index | Index of tensor to calculate absolute start position |
[in] | strides | Slice strides |
Definition at line 34 of file tensor_transform.cpp.
References Dimensions< T >::num_dimensions().
Referenced by calculate_end_on_index(), calculate_start_on_index(), calculate_strided_slice_coords(), and compute_strided_slice_output_shape().
std::tuple< Coordinates, Coordinates, Coordinates > calculate_strided_slice_coords | ( | TensorShape | input_shape, |
Coordinates | starts, | ||
Coordinates | ends, | ||
Coordinates | strides, | ||
int32_t | begin_mask = 0 , |
||
int32_t | end_mask = 0 , |
||
int32_t | shrink_axis_mask = 0 |
||
) |
Calculate start, end and stride coordinates for a strided slice.
[in] | input_shape | Input tensor shape |
[in] | starts | Start coordinates |
[in] | ends | End coordinates |
[in] | strides | Slice strides |
[in] | begin_mask | (Optional) If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | end_mask | (Optional) If the ith bit of end_mask is set, end[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | shrink_axis_mask | (Optional) If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved. |
Definition at line 120 of file tensor_transform.cpp.
References calculate_end_on_index(), calculate_start_on_index(), calculate_stride_on_index(), and Dimensions< T >::num_dimensions().
Referenced by CLStridedSliceKernel::configure(), NEStridedSliceKernel::configure(), and arm_compute::test::validation::reference::strided_slice().
TensorShape compute_strided_slice_output_shape | ( | TensorShape | input_shape, |
Coordinates | starts, | ||
Coordinates | ends, | ||
Coordinates | strides, | ||
int32_t | begin_mask = 0 , |
||
int32_t | end_mask = 0 , |
||
int32_t | shrink_axis_mask = 0 , |
||
bool | return_unshrinked = false |
||
) |
Computes output shape of strided slice.
[in] | input_shape | Input tensor shape |
[in] | starts | Absolute start coordinates |
[in] | ends | Absolute end coordinates |
[in] | strides | Slice strides |
[in] | begin_mask | (Optional) If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | end_mask | (Optional) If the ith bit of end_mask is set, end[i] is ignored and the fullest possible range in that dimension is used instead. |
[in] | shrink_axis_mask | (Optional) If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved. |
[in] | return_unshrinked | (Optional) Returns un-shrinked shape |
Definition at line 139 of file tensor_transform.cpp.
References calculate_end_on_index(), calculate_start_on_index(), calculate_stride_on_index(), arm_compute::mlgo::parser::end(), arm_compute::helpers::bit_ops::is_bit_set(), Dimensions< T >::num_dimensions(), arm_compute::test::validation::output_shape, arm_compute::test::validation::reference::range(), and TensorShape::set().
Referenced by StridedSliceLayerNode::compute_output_descriptor(), arm_compute::misc::shape_calculator::compute_slice_shape(), arm_compute::misc::shape_calculator::compute_strided_slice_shape(), and arm_compute::test::validation::reference::strided_slice().
int32_t construct_slice_end_mask | ( | Coordinates | ends | ) |
Constructs end mask in case we want to perform a slice operation using the strided slice interface.
[in] | ends | End coordinates |
Definition at line 172 of file tensor_transform.cpp.
References Dimensions< T >::num_dimensions().
Referenced by arm_compute::misc::shape_calculator::compute_slice_shape(), NESlice::configure(), CLSlice::configure(), NESlice::validate(), and CLSlice::validate().