Compute Library
18.05
|
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) |
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... | |
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... | |
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 41 of file Dimensions.h.
|
inlineexplicit |
Constructor to initialize the tensor shape.
[in] | dims | Values to initialize the dimensions. |
Definition at line 52 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 173 of file Dimensions.h.
Referenced by Dimensions< size_t >::cbegin(), and arm_compute::permute().
|
inline |
Returns a read-only (constant) iterator that points to the first element in the dimension array.
Definition at line 181 of file Dimensions.h.
|
inline |
Returns a read-only (constant) iterator that points to the first element in the dimension array.
Definition at line 189 of file Dimensions.h.
Referenced by arm_compute::operator==(), and SimpleTensor< T >::size().
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the dimension array.
Definition at line 213 of file Dimensions.h.
Referenced by arm_compute::operator==(), and SimpleTensor< T >::size().
|
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 138 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 162 of file Dimensions.h.
|
inline |
Returns a read/write iterator that points one past the last element in the dimension array.
Definition at line 197 of file Dimensions.h.
Referenced by Dimensions< size_t >::cend(), and arm_compute::permute().
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the dimension array.
Definition at line 205 of file Dimensions.h.
|
inline |
Returns the effective dimensionality of the tensor.
Definition at line 122 of file Dimensions.h.
Referenced by NumPyBinLoader::access_tensor(), TensorShape::broadcast_shape(), Dimensions< size_t >::collapse_from(), arm_compute::test::validation::compare_dimensions(), arm_compute::test::coord2index(), arm_compute::coords2index(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::reference::fully_connected_layer(), LeNet5Network< TensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, FullyConnectedLayerFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), MobileNetNetwork< TensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, DepthwiseConvolutionLayerFunction, ReshapeFunction, PoolingLayerFunction >::get_classifications(), MobileNetV1Network< TensorType, Accessor, ActivationLayerFunction, BatchNormalizationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, DepthwiseConvolutionFunction, ReshapeFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), AlexNetNetwork< ITensorType, TensorType, SubTensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, FullyConnectedLayerFunction, NormalizationLayerFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), arm_compute::test::index2coord(), arm_compute::index2coords(), arm_compute::intersect_valid_regions(), SubTensorInfo::num_dimensions(), TensorInfo::num_dimensions(), arm_compute::operator==(), arm_compute::permute(), Dimensions< size_t >::set_num_dimensions(), arm_compute::test::shape_to_valid_region(), arm_compute::test::shape_to_valid_region_gaussian_pyramid_half(), Window::use_tensor_dimensions(), and arm_compute::test::validation::validate().
|
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 103 of file Dimensions.h.
|
inline |
Generic accessor to get the size of any dimension.
[in] | dimension | Dimension of the wanted size |
Definition at line 116 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. |
Definition at line 74 of file Dimensions.h.
Referenced by arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::compute_strides(), arm_compute::test::validation::reference::depthwise_convolution(), arm_compute::test::validation::reference::dilate(), arm_compute::test::validation::reference::erode(), arm_compute::intersect_valid_regions(), arm_compute::permute(), arm_compute::test::validation::reference::remap(), TensorShape::set(), 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::transpose(), and arm_compute::test::validation::validate().
|
inline |
Set number of dimensions.
Definition at line 128 of file Dimensions.h.
Referenced by NPYLoader::init_tensor().
|
inline |
Alias to access the size of the first dimension.
Definition at line 81 of file Dimensions.h.
Referenced by PPMAccessor::access_tensor(), arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::calculate_depth_concatenate_shape(), arm_compute::misc::shape_calculator::calculate_width_concatenate_shape(), arm_compute::test::validation::reference::channel_combine(), arm_compute::test::validation::compare_dimensions(), arm_compute::misc::shape_calculator::compute_winograd_input_transform_shape(), arm_compute::test::validation::reference::convert_fully_connected_weights(), arm_compute::test::create_multi_image(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::reference::depthwise_convolution(), arm_compute::test::validation::reference::dilate(), arm_compute::test::validation::reference::erode(), arm_compute::test::validation::reference::fast_corners(), AssetsLibrary::fill_borders_with_garbage(), arm_compute::test::generate_random_keypoints(), arm_compute::test::generate_random_rois(), LeNet5Network< TensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, FullyConnectedLayerFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), MobileNetNetwork< TensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, DepthwiseConvolutionLayerFunction, ReshapeFunction, PoolingLayerFunction >::get_classifications(), MobileNetV1Network< TensorType, Accessor, ActivationLayerFunction, BatchNormalizationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, DepthwiseConvolutionFunction, ReshapeFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), AlexNetNetwork< ITensorType, TensorType, SubTensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, FullyConnectedLayerFunction, NormalizationLayerFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), arm_compute::test::validation::reference::median3x3(), arm_compute::test::validation::reference::non_linear_filter(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::reference::scale(), arm_compute::setup_assembly_kernel(), 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::transpose(), arm_compute::test::validation::transpose(), arm_compute::test::validation::reference::warp_affine(), and arm_compute::test::validation::reference::warp_perspective().
|
inline |
Alias to access the size of the second dimension.
Definition at line 86 of file Dimensions.h.
Referenced by PPMAccessor::access_tensor(), arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::calculate_depth_concatenate_shape(), arm_compute::test::validation::reference::channel_combine(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::misc::shape_calculator::compute_winograd_input_transform_shape(), arm_compute::test::validation::reference::convert_fully_connected_weights(), arm_compute::test::create_multi_image(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::reference::depthwise_convolution(), arm_compute::test::validation::reference::dilate(), arm_compute::test::validation::reference::erode(), arm_compute::test::validation::reference::fast_corners(), AssetsLibrary::fill_borders_with_garbage(), arm_compute::test::generate_random_keypoints(), arm_compute::test::generate_random_rois(), arm_compute::test::validation::reference::non_maxima_suppression(), AssemblyKernelGlue< int8_t, int32_t >::run(), arm_compute::setup_assembly_kernel(), 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::transpose(), and arm_compute::test::validation::transpose().
|
inline |
Alias to access the size of the third dimension.
Definition at line 91 of file Dimensions.h.
Referenced by arm_compute::calculate_depth_concatenate_shape(), arm_compute::test::validation::reference::convert_fully_connected_weights(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::reference::depthwise_convolution(), AssemblyKernelGlue< int8_t, int32_t >::run(), arm_compute::setup_assembly_kernel(), and arm_compute::test::validation::tensor_elem_at().
|
static |
Number of dimensions the tensor has.
Definition at line 45 of file Dimensions.h.