21.02
|
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.
Referenced by Dimensions< size_t >::Dimensions().
|
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 215 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 223 of file Dimensions.h.
|
inline |
Returns a read-only (constant) iterator that points to the first element in the dimension array.
Definition at line 231 of file Dimensions.h.
Referenced by GCIm2ColKernel::configure(), GCFullyConnectedLayer::configure(), NEFullyConnectedLayer::configure(), CLFullyConnectedLayer::configure(), arm_compute::operator==(), arm_compute::test::validation::reference::slice(), arm_compute::test::validation::reference::strided_slice(), NESlice::validate(), CLSlice::validate(), NEFullyConnectedLayer::validate(), and CLFullyConnectedLayer::validate().
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the dimension array.
Definition at line 255 of file Dimensions.h.
Referenced by GCIm2ColKernel::configure(), GCFullyConnectedLayer::configure(), NEFullyConnectedLayer::configure(), CLFullyConnectedLayer::configure(), arm_compute::operator==(), NEFullyConnectedLayer::validate(), and CLFullyConnectedLayer::validate().
|
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 159 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 183 of file Dimensions.h.
Referenced by arm_compute::misc::shape_calculator::compute_softmax_shape().
|
inline |
Returns a read/write iterator that points one past the last element in the dimension array.
Definition at line 239 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 247 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 108 of file Dimensions.h.
|
inline |
Returns the effective dimensionality of the tensor.
Definition at line 143 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::misc::shape_calculator::compute_split_shape(), arm_compute::helpers::tensor_transform::compute_strided_slice_output_shape(), FullyConnectedLayerNode::compute_weights_descriptor(), CLStridedSliceKernel::configure(), CLSelectKernel::configure(), NEReduceMean::configure(), ClPermuteKernel::configure(), CLReduceMean::configure(), NEUnstack::configure(), CLUnstack::configure(), NESelectKernel::configure(), NEGEMMLowpOffsetContributionKernel::configure(), CLGEMMLowpOffsetContributionKernel::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), NEGEMMLowpOffsetContributionOutputStageKernel::configure(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::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::DATA_TEST_CASE(), arm_compute::test::validation::reference::fully_connected_layer(), arm_compute::test::index2coord(), arm_compute::index2coords(), 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::permute(), arm_compute::permute_strides(), CLComparisonKernel::run(), ClElementwiseKernel::run_op(), CLPixelWiseMultiplicationKernel::run_op(), CLComplexPixelWiseMultiplicationKernel::run_op(), arm_compute::test::validation::reference::select(), Dimensions< size_t >::set_num_dimensions(), TensorInfo::set_tensor_shape(), arm_compute::test::shape_to_valid_region(), arm_compute::test::shape_to_valid_region_gaussian_pyramid_half(), 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(), NESlice::validate(), SplitLayerNode::validate(), CLSlice::validate(), NEUnstack::validate(), CLUnstack::validate(), NESelectKernel::validate(), ClCropKernel::validate(), NECropKernel::validate(), arm_compute::test::validation::validate(), arm_compute::test::detail::validate_npy_header(), and arm_compute::test::validation::zeros().
|
default |
Allow instances of this class to be copied.
Referenced by Dimensions< size_t >::Dimensions().
|
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 124 of file Dimensions.h.
|
inline |
Generic accessor to get the size of any dimension.
[in] | dimension | Dimension of the wanted size |
Definition at line 137 of file Dimensions.h.
|
inline |
Remove dimension of a given index.
[in] | idx | Dimension index to remove |
Definition at line 196 of file Dimensions.h.
|
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 76 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(), NEUnstack::configure(), CLUnstack::configure(), NEWinogradConvolutionLayer::configure(), CPPSplit< CLSlice, ICLTensor >::configure(), arm_compute::convert_window_coord_to_position(), arm_compute::test::validation::reference::dilate(), arm_compute::test::validation::reference::erode(), NPYLoader::fill_tensor(), arm_compute::test::validation::reference::gather(), arm_compute::intersect_valid_regions(), arm_compute::test::validation::reference::logical_binary_op(), NEGatherKernel::NEGatherKernel(), arm_compute::test::colorconvert_helper::detail::nv_to_yuv4(), arm_compute::permute(), arm_compute::permute_strides(), arm_compute::test::validation::reference::remap(), arm_compute::test::validation::reference::reorg_layer(), NEReorgLayerKernel::run(), arm_compute::test::shape_to_valid_region(), arm_compute::test::shape_to_valid_region_gaussian_pyramid_half(), arm_compute::test::shape_to_valid_region_laplacian_pyramid(), arm_compute::test::validation::reference::slice(), arm_compute::test::validation::reference::softmax_layer_generic(), arm_compute::test::validation::reference::strided_slice(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::transpose(), CPPSplit< CLSlice, ICLTensor >::validate(), NEUnstack::validate(), CLUnstack::validate(), and arm_compute::test::validation::validate().
|
inline |
Set number of dimensions.
Definition at line 149 of file Dimensions.h.
Referenced by CpuFloorKernel::configure(), CpuLogits1DMaxKernel::configure(), CpuPermuteKernel::configure(), CpuConcatenateHeightKernel::configure(), CpuConcatenateWidthKernel::configure(), CpuPoolingKernel::configure(), CpuConcatenateBatchKernel::configure(), CPPDetectionOutputLayer::configure(), CpuConcatenateDepthKernel::configure(), NEChannelShuffleLayerKernel::configure(), NEPriorBoxLayerKernel::configure(), CPPUpsampleKernel::configure(), CPPPermuteKernel::configure(), CpuSubKernel::configure(), NENormalizationLayerKernel::configure(), ClPermuteKernel::configure(), NEQuantizationLayerKernel::configure(), NERangeKernel::configure(), NEBoundingBoxTransformKernel::configure(), NEScaleKernel::configure(), NEPadLayerKernel::configure(), NEDirectConvolutionLayerOutputStageKernel::configure(), NEReductionOperationKernel::configure(), NEROIPoolingLayerKernel::configure(), NEGEMMMatrixMultiplyKernel::configure(), NEROIAlignLayerKernel::configure(), NEBatchNormalizationLayerKernel::configure(), NEGEMMLowpMatrixMultiplyKernel::configure(), NEDepthConvertLayerKernel::configure(), NEDepthwiseConvolutionLayerNativeKernel::configure(), NEGEMMInterleave4x4Kernel::configure(), NEGEMMLowpOffsetContributionKernel::configure(), NEPixelWiseMultiplicationKernel::configure(), CpuLogits1DSoftmaxKernel< IS_LOG >::configure(), NEGEMMTranspose1xWKernel::configure(), NEComplexPixelWiseMultiplicationKernel::configure(), DATA_TEST_CASE(), and NPYLoader::init_tensor().
|
inline |
Alias to access the size of the first dimension.
Definition at line 87 of file Dimensions.h.
Referenced by ImageAccessor::access_tensor(), ValidationInputAccessor::access_tensor(), arm_compute::cpu::add_qasymm8_neon(), arm_compute::cpu::add_qasymm8_signed_neon(), arm_compute::cpu::add_qsymm16_neon(), arm_compute::cpu::add_same_neon(), arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::test::validation::reference::channel_combine(), 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(), arm_compute::test::validation::compare_dimensions(), arm_compute::misc::shape_calculator::compute_output_stage_shape(), arm_compute::misc::shape_calculator::compute_vector_to_tensor_output_shape(), ClCopyKernel::configure(), ClElementWiseUnaryKernel::configure(), CLStridedSliceKernel::configure(), CLDequantizationLayerKernel::configure(), CLSelectKernel::configure(), CLTileKernel::configure(), CLQuantizationLayerKernel::configure(), CLGEMMLowpOffsetContributionKernel::configure(), NEFFTConvolutionLayer::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), NEHarrisCorners::configure(), CLHarrisCorners::configure(), CLFFTConvolutionLayer::configure(), CLCopyToArrayKernel::configure(), arm_compute::test::validation::reference::convert_fully_connected_weights(), ITensor::copy_from(), arm_compute::test::create_multi_image(), arm_compute::test::validation::reference::deconvolution_layer(), arm_compute::test::validation::reference::dilate(), arm_compute::cpu::elementwise_comp_quantized_signed(), 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(), arm_compute::test::validation::reference::fast_corners(), AssetsLibrary::fill_borders_with_garbage(), arm_compute::test::generate_random_keypoints(), PyramidInfo::init(), CLMultiImage::init_auto_padding(), MultiImage::init_auto_padding(), NEDepthwiseConvolutionAssemblyDispatch::is_optimized_supported(), arm_compute::test::validation::reference::median3x3(), arm_compute::cpu::neon_softmax_logits_1d_float(), arm_compute::test::validation::reference::non_linear_filter(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::reference::pad_layer(), NEGEMMLowpOffsetContributionKernel::run(), NEWeightsReshapeKernel::run(), NEGEMMLowpOffsetContributionOutputStageKernel::run(), arm_compute::test::validation::reference::scale_core(), arm_compute::test::validation::reference::select(), arm_compute::test::shape_to_valid_region(), arm_compute::test::shape_to_valid_region_gaussian_pyramid_half(), arm_compute::cpu::sub_qasymm8_neon(), arm_compute::cpu::sub_qasymm8_signed_neon(), arm_compute::cpu::sub_qsymm16_neon(), arm_compute::cpu::sub_same_neon(), 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(), NEQLSTMLayerNormalizationKernel::validate(), NEConvertFullyConnectedWeightsKernel::validate(), NESelectKernel::validate(), NEFFTConvolutionLayer::validate(), NEDeconvolutionLayer::validate(), CLFFTConvolutionLayer::validate(), arm_compute::test::validation::reference::warp_affine(), arm_compute::test::validation::reference::warp_perspective(), and PyramidInfo::width().
|
inline |
Alias to access the size of the second dimension.
Definition at line 92 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::channel_combine(), arm_compute::test::validation::reference::col2im(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::misc::shape_calculator::compute_output_stage_shape(), CLSelectKernel::configure(), CLGEMMLowpOffsetContributionKernel::configure(), NEFFTConvolutionLayer::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), NEHarrisCorners::configure(), CLHarrisCorners::configure(), CLFFTConvolutionLayer::configure(), arm_compute::test::validation::reference::convert_fully_connected_weights(), ITensor::copy_from(), arm_compute::test::create_multi_image(), arm_compute::test::validation::reference::deconvolution_layer(), DetectionOutputAccessor::DetectionOutputAccessor(), arm_compute::test::validation::reference::dilate(), arm_compute::test::validation::reference::erode(), SubTensorInfo::extend_padding(), arm_compute::test::validation::reference::fast_corners(), AssetsLibrary::fill_borders_with_garbage(), arm_compute::test::generate_random_keypoints(), PyramidInfo::height(), PyramidInfo::init(), CLMultiImage::init_auto_padding(), MultiImage::init_auto_padding(), NEDepthwiseConvolutionAssemblyDispatch::is_optimized_supported(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::cpu::offset_no_padding(), arm_compute::test::validation::reference::pad_layer(), arm_compute::cpu::poolingMxN_fp32_neon_nhwc(), arm_compute::cpu::poolingMxN_q8_neon_nhwc(), NEGEMMLowpOffsetContributionKernel::run(), NEWeightsReshapeKernel::run(), CLWinogradOutputTransformKernel::run(), NEGEMMLowpOffsetContributionOutputStageKernel::run(), NEWinogradLayerTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run(), arm_compute::test::shape_to_valid_region(), arm_compute::test::shape_to_valid_region_gaussian_pyramid_half(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), arm_compute::test::validation::transpose(), NEConvertFullyConnectedWeightsKernel::validate(), NEDeconvolutionLayer::validate(), and NEGEMMLowpMatrixAReductionKernel::validate().
|
inline |
Alias to access the size of the third dimension.
Definition at line 97 of file Dimensions.h.
Referenced by arm_compute::test::validation::reference::col2im(), CLStridedSliceKernel::configure(), ClDepthConcatenateKernel::configure(), GCDepthConcatenateLayerKernel::configure(), arm_compute::test::validation::DATA_TEST_CASE(), NEDepthwiseConvolutionAssemblyDispatch::is_optimized_supported(), DepthConcatSubTensorMutator::mutate(), arm_compute::cpu::offset_no_padding(), arm_compute::test::validation::reference::pad_layer(), arm_compute::cpu::poolingMxN_fp32_neon_nhwc(), arm_compute::cpu::poolingMxN_q8_neon_nhwc(), NEWeightsReshapeKernel::run(), CLWeightsReshapeKernel::run(), NEWinogradLayerTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::reference::tile(), and NEDeconvolutionLayer::validate().
|
static |
Number of dimensions the tensor has.
Definition at line 46 of file Dimensions.h.