24.02.1
|
Dimensions with dimensionality. More...
#include <Dimensions.h>
Public Member Functions | |
template<typename... Ts> | |
Dimensions (Ts... dims) | |
Constructor to initialize the tensor shape. More... | |
Dimensions (const Dimensions &)=default | |
Allow instances of this class to be copy constructed. More... | |
Dimensions & | operator= (const Dimensions &)=default |
Allow instances of this class to be copied. More... | |
Dimensions (Dimensions &&)=default | |
Allow instances of this class to be move constructed. More... | |
Dimensions & | operator= (Dimensions &&)=default |
Allow instances of this class to be moved. More... | |
void | set (size_t dimension, T value, bool increase_dim_unit=true) |
Accessor to set the value of one of the dimensions. More... | |
T | x () const |
Alias to access the size of the first dimension. More... | |
T | y () const |
Alias to access the size of the second dimension. More... | |
T | z () const |
Alias to access the size of the third dimension. More... | |
void | increment (size_t dim, T step=1) |
Increments the given dimension by a step size, avoiding overflows. More... | |
const T & | operator[] (size_t dimension) const |
Generic accessor to get the size of any dimension. More... | |
T & | operator[] (size_t dimension) |
Generic accessor to get the size of any dimension. More... | |
unsigned int | num_dimensions () const |
Returns the effective dimensionality of the tensor. More... | |
void | set_num_dimensions (size_t num_dimensions) |
Set number of dimensions. More... | |
void | collapse (const size_t n, const size_t first=0) |
Collapse dimensions. More... | |
void | collapse_from (size_t start) |
Collapse dimensions starting from a given point. More... | |
void | remove (size_t idx) |
Remove dimension of a given index. More... | |
std::array< T, num_max_dimensions >::iterator | begin () |
Returns a read/write iterator that points to the first element in the dimension array. More... | |
std::array< T, num_max_dimensions >::const_iterator | begin () const |
Returns a read-only (constant) iterator that points to the first element in the dimension array. More... | |
std::array< T, num_max_dimensions >::const_iterator | cbegin () const |
Returns a read-only (constant) iterator that points to the first element in the dimension array. More... | |
std::array< T, num_max_dimensions >::iterator | end () |
Returns a read/write iterator that points one past the last element in the dimension array. More... | |
std::array< T, num_max_dimensions >::const_iterator | end () const |
Returns a read-only (constant) iterator that points one past the last element in the dimension array. More... | |
std::array< T, num_max_dimensions >::const_iterator | cend () const |
Returns a read-only (constant) iterator that points one past the last element in the dimension array. More... | |
Static Public Attributes | |
static constexpr size_t | num_max_dimensions = MAX_DIMS |
Number of dimensions the tensor has. More... | |
Dimensions with dimensionality.
Definition at line 42 of file Dimensions.h.
|
inlineexplicit |
Constructor to initialize the tensor shape.
[in] | dims | Values to initialize the dimensions. |
Definition at line 53 of file Dimensions.h.
|
default |
Allow instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
|
inline |
Returns a read/write iterator that points to the first element in the dimension array.
Definition at line 214 of file Dimensions.h.
Referenced by arm_compute::misc::shape_calculator::calculate_reduce_mean_shape(), Dimensions< size_t >::cbegin(), NEReduceMean::configure(), CLReduceMean::configure(), arm_compute::permute(), and arm_compute::permute_strides().
|
inline |
Returns a read-only (constant) iterator that points to the first element in the dimension array.
Definition at line 222 of file Dimensions.h.
|
inline |
Returns a read-only (constant) iterator that points to the first element in the dimension array.
Definition at line 230 of file Dimensions.h.
Referenced by arm_compute::operator==(), arm_compute::test::validation::reference::slice(), arm_compute::test::validation::reference::strided_slice(), NESlice::validate(), and CLSlice::validate().
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the dimension array.
Definition at line 254 of file Dimensions.h.
Referenced by arm_compute::operator==().
|
inline |
Collapse dimensions.
[in] | n | Number of dimensions to collapse into first . |
[in] | first | Dimensions into which the following n are collapsed. |
Definition at line 158 of file Dimensions.h.
Referenced by TensorShape::collapse(), and Dimensions< size_t >::collapse_from().
|
inline |
Collapse dimensions starting from a given point.
[in] | start | Starting point of collapsing dimensions |
Definition at line 182 of file Dimensions.h.
Referenced by arm_compute::misc::shape_calculator::compute_softmax_shape(), and ClMatMulNativeDefaultConfigValhall::configure().
|
inline |
Returns a read/write iterator that points one past the last element in the dimension array.
Definition at line 238 of file Dimensions.h.
Referenced by Dimensions< size_t >::cend(), arm_compute::permute(), and arm_compute::permute_strides().
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the dimension array.
Definition at line 246 of file Dimensions.h.
|
inline |
Increments the given dimension by a step size, avoiding overflows.
[in] | dim | Dimension to increment. |
[in] | step | Step to increment dim by. |
Definition at line 107 of file Dimensions.h.
|
inline |
Returns the effective dimensionality of the tensor.
Definition at line 142 of file Dimensions.h.
Referenced by TensorInfo::auto_padding(), TensorShape::broadcast_shape(), arm_compute::helpers::tensor_transform::calculate_end_on_index(), arm_compute::calculate_max_enlarged_window(), arm_compute::calculate_max_window(), arm_compute::calculate_max_window_horizontal(), arm_compute::misc::shape_calculator::calculate_reduce_mean_shape(), arm_compute::helpers::tensor_transform::calculate_start_on_index(), arm_compute::helpers::tensor_transform::calculate_stride_on_index(), arm_compute::helpers::tensor_transform::calculate_strided_slice_coords(), arm_compute::misc::shape_calculator::calculate_unstack_shape(), arm_compute::calculate_valid_region_scale(), Dimensions< size_t >::collapse_from(), arm_compute::test::validation::compare_dimensions(), arm_compute::misc::shape_calculator::compute_gather_shape(), arm_compute::misc::shape_calculator::compute_im2col_conv_shape(), DetectionOutputLayerNode::compute_output_descriptor(), SplitLayerNode::compute_output_descriptor(), FullyConnectedLayerNode::compute_output_descriptor(), arm_compute::misc::shape_calculator::compute_padded_shape(), arm_compute::misc::shape_calculator::compute_softmax_shape(), arm_compute::helpers::tensor_transform::compute_strided_slice_output_shape(), FullyConnectedLayerNode::compute_weights_descriptor(), ClMatMulNativeDefaultConfigValhall::configure(), ClPermuteKernel::configure(), CLStridedSliceKernel::configure(), CLSelectKernel::configure(), CpuGemmLowpOffsetContributionKernel::configure(), ClSoftmaxKernel::configure(), NESelectKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), NEGatherKernel::configure(), NEReduceMean::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLReduceMean::configure(), CpuGemmLowpOffsetContributionOutputStageKernel::configure(), CPPSplit< CLSlice, ICLTensor >::configure(), arm_compute::helpers::tensor_transform::construct_slice_end_mask(), arm_compute::convert_negative_axis(), arm_compute::test::coord2index(), arm_compute::coords2index(), arm_compute::test::validation::reference::fully_connected_layer(), arm_compute::intersect_valid_regions(), SubTensorInfo::num_dimensions(), TensorInfo::num_dimensions(), SubTensorInfo::offset_element_in_bytes(), TensorInfo::offset_element_in_bytes(), arm_compute::operator<<(), arm_compute::operator==(), arm_compute::permute(), arm_compute::permute_strides(), CLComparisonKernel::run(), ClElementwiseKernel::run_op(), ClMulKernel::run_op(), ClComplexMulKernel::run_op(), arm_compute::test::validation::reference::select(), Dimensions< size_t >::set_num_dimensions(), TensorInfo::set_tensor_shape(), arm_compute::test::validation::reference::slice(), arm_compute::test::validation::reference::stack_layer(), arm_compute::test::validation::reference::strided_slice(), Window::use_tensor_dimensions(), CPPSplit< CLSlice, ICLTensor >::validate(), NESelectKernel::validate(), NESlice::validate(), arm_compute::test::validation::validate(), CLSlice::validate(), arm_compute::test::detail::validate_npy_header(), and arm_compute::test::validation::zeros().
|
default |
Allow instances of this class to be copied.
|
default |
Allow instances of this class to be moved.
|
inline |
Generic accessor to get the size of any dimension.
[in] | dimension | Dimension of the wanted size |
Definition at line 136 of file Dimensions.h.
|
inline |
Generic accessor to get the size of any dimension.
[in] | dimension | Dimension of the wanted size |
Definition at line 123 of file Dimensions.h.
|
inline |
Remove dimension of a given index.
[in] | idx | Dimension index to remove |
Definition at line 195 of file Dimensions.h.
Referenced by ClSoftmaxKernel::run_op().
|
inline |
Accessor to set the value of one of the dimensions.
[in] | dimension | Dimension for which the value is set. |
[in] | value | Value to be set for the dimension. |
[in] | increase_dim_unit | (Optional) Set to true if new unit dimensions increase the number of dimensions (e.g. for Coordinates), false otherwise (e.g. for TensorShapes) |
Definition at line 75 of file Dimensions.h.
Referenced by arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::calculate_valid_region_scale(), arm_compute::test::colorconvert_helper::detail::colorconvert_iyuv_to_rgb(), arm_compute::test::colorconvert_helper::detail::colorconvert_nv12_to_rgb(), SplitLayerNode::compute_output_descriptor(), arm_compute::compute_strides(), AccessWindowTranspose::compute_valid_region(), AccessWindowStatic::compute_valid_region(), AccessWindowRectangle::compute_valid_region(), NEDepthToSpaceLayerKernel::configure(), NEUnstack::configure(), CLUnstack::configure(), CpuWinogradConv2d::configure(), CPPSplit< CLSlice, ICLTensor >::configure(), arm_compute::convert_window_coord_to_position(), arm_compute::test::validation::reference::erode(), NPYLoader::fill_tensor(), arm_compute::test::validation::reference::gather(), arm_compute::cpu::in_bounds_crop_window(), arm_compute::intersect_valid_regions(), arm_compute::test::colorconvert_helper::detail::nv_to_yuv4(), arm_compute::permute(), arm_compute::permute_strides(), arm_compute::test::validation::reference::reorg_layer(), NEReorgLayerKernel::run(), NEStridedSliceKernel::run_op(), TensorShape::set(), ValidRegion::set(), arm_compute::test::shape_to_valid_region(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::transpose(), CPPSplit< CLSlice, ICLTensor >::validate(), NEUnstack::validate(), and CLUnstack::validate().
|
inline |
Set number of dimensions.
Definition at line 148 of file Dimensions.h.
Referenced by CpuTransposeKernel::configure(), CPPDetectionOutputLayer::configure(), CPPUpsampleKernel::configure(), and CPPPermuteKernel::configure().
|
inline |
Alias to access the size of the first dimension.
Definition at line 86 of file Dimensions.h.
Referenced by ImageAccessor::access_tensor(), ValidationInputAccessor::access_tensor(), arm_compute::cpu::add_qasymm8_signed_sve2(), arm_compute::cpu::add_qasymm8_sve2(), arm_compute::cpu::add_qsymm16_neon(), arm_compute::cpu::add_qsymm16_sve2(), arm_compute::cpu::add_same_neon(), arm_compute::cpu::add_same_sve(), arm_compute::cpu::add_sub_qasymm8_neon(), arm_compute::cpu::add_sub_qasymm8_signed_neon(), arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::test::validation::reference::col2im(), arm_compute::test::colorconvert_helper::detail::colorconvert_iyuv_to_rgb(), arm_compute::test::colorconvert_helper::detail::colorconvert_nv12_to_rgb(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_iyuv(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_nv12(), arm_compute::test::colorconvert_helper::detail::colorconvert_yuyv_to_rgb(), ClMatMulNativeDefaultConfigValhall::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClMatMulNativeKernel::configure(), CLStridedSliceKernel::configure(), ClMatMulLowpNativeKernel::configure(), CLSelectKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CpuMatMul::configure(), ClMatMulNativeMMULKernel::configure(), NEFFTConvolutionLayer::configure(), CLFFTConvolutionLayer::configure(), arm_compute::test::validation::reference::convert_fully_connected_weights(), arm_compute::cpu::kernels::convolve_nchw(), arm_compute::test::validation::reference::deconvolution_layer(), arm_compute::cpu::elementwise_arithmetic_op(), arm_compute::cpu::elementwise_arithmetic_quantized_op(), arm_compute::cpu::elementwise_comp_quantized_signed(), arm_compute::cpu::elementwise_comparison_op(), arm_compute::cpu::elementwise_comparison_quantized_op(), arm_compute::cpu::elementwise_op(), arm_compute::cpu::elementwise_op_quantized(), arm_compute::cpu::elementwise_op_quantized_signed(), arm_compute::test::validation::reference::erode(), SubTensorInfo::extend_padding(), GpuCkwMatMul::get_name(), WindowIterator< L >::iterate_2D(), arm_compute::cpu::mul_F32_F32_F32(), arm_compute::cpu::neon_softmax_float(), arm_compute::cpu::neon_softmax_quantized(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::reference::pad_layer(), reshape_layer(), CpuMatMul::run(), arm_compute::test::validation::reference::select(), ClMatMulNativeDefaultVariantValhall::select_kernel(), arm_compute::cpu::sub_qsymm16_neon(), arm_compute::cpu::sub_same_neon(), arm_compute::cpu::sve2_softmax_logits_1d_quantized(), arm_compute::cpu::sve_softmax_logits_1d_float(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::TEST_CASE(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), arm_compute::test::validation::transpose(), ClMatMulLowpNativeMMULKernel::validate(), NEQLSTMLayerNormalizationKernel::validate(), NESelectKernel::validate(), ClMatMulNativeMMULKernel::validate(), NEFFTConvolutionLayer::validate(), NEDeconvolutionLayer::validate(), CLFFTConvolutionLayer::validate(), and arm_compute::opencl::kernels::validate_matmul_input_shapes().
|
inline |
Alias to access the size of the second dimension.
Definition at line 91 of file Dimensions.h.
Referenced by ImageAccessor::access_tensor(), ValidationInputAccessor::access_tensor(), arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::test::validation::reference::col2im(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_nv12_to_rgb(), ClMatMulNativeDefaultConfigValhall::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClMatMulNativeKernel::configure(), ClMatMulLowpNativeKernel::configure(), CLSelectKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), CpuMatMul::configure(), ClMatMulNativeMMULKernel::configure(), NEFFTConvolutionLayer::configure(), CLFFTConvolutionLayer::configure(), arm_compute::test::validation::reference::convert_fully_connected_weights(), arm_compute::cpu::kernels::convolve_nchw(), arm_compute::cpu::kernels::convolve_nhwc(), arm_compute::test::validation::reference::deconvolution_layer(), arm_compute::test::validation::reference::erode(), SubTensorInfo::extend_padding(), GpuCkwMatMul::get_name(), WindowIterator< L >::iterate_2D(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::reference::pad_layer(), reshape_layer(), CpuMatMul::run(), ClMatMulNativeDefaultVariantValhall::select_kernel(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), arm_compute::test::validation::transpose(), ClMatMulLowpNativeMMULKernel::validate(), ClMatMulNativeMMULKernel::validate(), NEDeconvolutionLayer::validate(), and arm_compute::opencl::kernels::validate_matmul_input_shapes().
|
inline |
Alias to access the size of the third dimension.
Definition at line 96 of file Dimensions.h.
Referenced by arm_compute::test::validation::reference::col2im(), ClMatMulNativeDefaultConfigValhall::configure(), CLStridedSliceKernel::configure(), CpuMatMul::configure(), arm_compute::cpu::kernels::convolve_nchw(), arm_compute::cpu::kernels::convolve_nhwc(), WindowIterator< L >::iterate_3D(), DepthConcatSubTensorMutator::mutate(), arm_compute::test::validation::reference::pad_layer(), CpuMatMul::run(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::reference::tile(), and NEDeconvolutionLayer::validate().
|
staticconstexpr |
Number of dimensions the tensor has.
Definition at line 46 of file Dimensions.h.
Referenced by Dimensions< size_t >::operator[](), and Dimensions< size_t >::set().