Compute Library
 21.05
ITensorInfo Class Referenceabstract

Store the tensor's metadata. More...

#include <ITensorInfo.h>

Collaboration diagram for ITensorInfo:
[legend]

Public Types

using TensorDimsState = Coordinates
 

Public Member Functions

virtual ~ITensorInfo ()=default
 Default virtual destructor. More...
 
virtual ITensorInfoset_data_type (DataType data_type)=0
 Set the data type to the specified value. More...
 
virtual ITensorInfoset_num_channels (int num_channels)=0
 Set the number of channels to the specified value. More...
 
virtual ITensorInfoset_format (Format format)=0
 Set the format of an already initialized tensor. More...
 
virtual ITensorInfoset_tensor_shape (const TensorShape &shape)=0
 Set the shape of an already initialized tensor. More...
 
virtual ITensorInfoset_tensor_dims_state (const TensorDimsState &state)=0
 Set the state for each dimension of the tensor. More...
 
virtual ITensorInfoset_quantization_info (const QuantizationInfo &quantization_info)=0
 Set the quantization settings (scale and offset) of the tensor. More...
 
virtual ITensorInfoset_data_layout (const DataLayout &data_layout)=0
 Set the data layout of the tensor. More...
 
virtual ITensorInforeset_padding ()=0
 Resets the padding settings of the tensor. More...
 
virtual bool auto_padding ()=0
 Update the offset to the first element and the strides to automatically computed values. More...
 
virtual bool extend_padding (const PaddingSize &padding)=0
 Update the offset to the first element, the strides and the total size. More...
 
virtual size_t dimension (size_t index) const =0
 Return the size of the requested dimension. More...
 
virtual size_t dimension (DataLayoutDimension dimension) const =0
 Return the size of the requested data layout dimension. More...
 
virtual const Stridesstrides_in_bytes () const =0
 The strides in bytes for accessing each dimension of the tensor. More...
 
virtual size_t offset_first_element_in_bytes () const =0
 The offset from the beginning of the memory allocation to the first element of the tensor. More...
 
virtual int32_t offset_element_in_bytes (const Coordinates &pos) const =0
 The offset in bytes from the beginning of the memory allocation to access the element at position (x, y, z ...) More...
 
virtual size_t element_size () const =0
 Element size in bytes calculated as data_size() * num_channels() More...
 
virtual size_t num_dimensions () const =0
 The number of dimensions of the tensor (rank) More...
 
virtual size_t num_channels () const =0
 The number of channels for each tensor element. More...
 
virtual const TensorShapetensor_shape () const =0
 Size for each dimension of the tensor. More...
 
virtual const TensorDimsStatetensor_dims_state () const =0
 State of each dimension of the tensor shape. More...
 
virtual DataType data_type () const =0
 Data type used for each element of the tensor. More...
 
virtual Format format () const =0
 Colour format of the image. More...
 
virtual size_t total_size () const =0
 Returns the total size of the tensor in bytes. More...
 
virtual PaddingSize padding () const =0
 Padding of tensor. More...
 
virtual bool has_padding () const =0
 Checks if the tensor has been allocated with padding or not. More...
 
virtual bool is_resizable () const =0
 Flag indicating whether the size of the tensor can be changed. More...
 
virtual bool is_dynamic () const =0
 Flag indicating whether the shape of the tensor is dynamic, meaning that it can change on kernel/function execution. More...
 
virtual ITensorInfoset_is_resizable (bool is_resizable)=0
 Set the flag whether the tensor size can be changed. More...
 
virtual ValidRegion valid_region () const =0
 Valid region of the tensor. More...
 
virtual void set_valid_region (const ValidRegion &valid_region)=0
 Set the valid region of the tensor. More...
 
virtual QuantizationInfo quantization_info () const =0
 Get the quantization settings (scale and offset) of the tensor. More...
 
virtual DataLayout data_layout () const =0
 Get the data layout of the tensor. More...
 
- Public Member Functions inherited from ICloneable< ITensorInfo >
virtual ~ICloneable ()=default
 Default virtual desctructor. More...
 
virtual std::unique_ptr< ITensorInfoclone () const=0
 Provide a clone of the current object of class T. More...
 

Static Public Member Functions

static constexpr int32_t get_dynamic_state_value ()
 Get the value representing dynamic dimension state. More...
 
static constexpr int32_t get_static_state_value ()
 Get the value representing static dimension state. More...
 
template<typename... Infos>
static std::pair< TensorShape, ValidRegionbroadcast_shape_and_valid_region (const Infos &... infos)
 If infos are broadcast compatible tensor info's, return the broadcasted shape and the intersection of the broadcasted valid regions of the tensors. More...
 

Detailed Description

Store the tensor's metadata.

Definition at line 40 of file ITensorInfo.h.

Member Typedef Documentation

◆ TensorDimsState

Definition at line 43 of file ITensorInfo.h.

Constructor & Destructor Documentation

◆ ~ITensorInfo()

virtual ~ITensorInfo ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ auto_padding()

virtual bool auto_padding ( )
pure virtual

Update the offset to the first element and the strides to automatically computed values.

Note
The padding used by this method is really conservative so that the tensor can be used for most functions.
Returns
True if the strides or the offset to the first element have changed.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by SubTensorInfo::auto_padding(), and AccessWindowAutoPadding::update_padding_if_needed().

◆ broadcast_shape_and_valid_region()

static std::pair<TensorShape, ValidRegion> broadcast_shape_and_valid_region ( const Infos &...  infos)
inlinestatic

If infos are broadcast compatible tensor info's, return the broadcasted shape and the intersection of the broadcasted valid regions of the tensors.

Two tensor info's are broadcast compatible if their shapes are broadcast compatible.

Two tensor shapes are broadcast compatible if for each dimension, they're equal or one of them is 1.

If two shapes are compatible, each dimension in the broadcasted shape is the max of the original dimensions.

Parameters
[in]infosTensor info's.
Returns
The broadcasted shape and valid region, or an empty shape and valid region if the info's are not broadcast compatible.

Definition at line 287 of file ITensorInfo.h.

288  {
289  TensorShape bc_shape = TensorShape::broadcast_shape(infos.tensor_shape()...);
290  ValidRegion bc_valid_region{ Coordinates(), bc_shape };
291 
292  auto broadcast_valid_region = [&bc_valid_region](const ITensorInfo & info)
293  {
294  if(info.num_dimensions() != 0)
295  {
296  for(size_t d = 0; d < bc_valid_region.shape.num_dimensions(); ++d)
297  {
298  const bool is_broadcast = (info.tensor_shape()[d] == 1);
299 
300  const int anchor_max = std::max(bc_valid_region.anchor[d], info.valid_region().anchor[d]);
301  const size_t valid_min = std::min(bc_valid_region.shape[d], info.valid_region().shape[d]);
302 
303  if(!is_broadcast || (valid_min == 0))
304  {
305  bc_valid_region.anchor.set(d, anchor_max);
306  bc_valid_region.shape.set(d, valid_min);
307  }
308  }
309  }
310  };
311 
312  utility::for_each(broadcast_valid_region, infos...);
313 
314  return std::pair<TensorShape, ValidRegion>(bc_shape, bc_valid_region);
315  }
static TensorShape broadcast_shape(const Shapes &... shapes)
If shapes are broadcast compatible, return the broadcasted shape.
Definition: TensorShape.h:211
void for_each(F &&)
Base case of for_each.
Definition: Utility.h:110
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

References TensorShape::broadcast_shape(), arm_compute::utility::for_each(), arm_compute::test::validation::info, and TensorShape::set().

◆ data_layout()

◆ data_type()

virtual DataType data_type ( ) const
pure virtual

Data type used for each element of the tensor.

Returns
Tensor data type

Implemented in TensorInfo, and SubTensorInfo.

Referenced by NumPyAccessor::access_tensor(), ValidationOutputAccessor::access_tensor(), VerifyAccessor< D >::access_tensor(), DetectionOutputAccessor::access_tensor(), TopNPredictionsAccessor::access_tensor(), RandomAccessor::access_tensor(), arm_compute::auto_init_if_empty(), arm_compute::quantization::compute_quantized_multipliers_and_shifts(), NELogicalKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClSoftmax::configure(), ClFillKernel::configure(), NEInstanceNormalizationLayerKernel::configure(), NEComputeAllAnchorsKernel::configure(), NEQLSTMLayerNormalizationKernel::configure(), CLSelectKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CPPBoxWithNonMaximaSuppressionLimit::configure(), CLComputeAllAnchorsKernel::configure(), NERangeKernel::configure(), ClDirectConvolutionKernel::configure(), NEBoundingBoxTransformKernel::configure(), CLGEMMLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), CpuDepthwiseConvolutionNativeKernel::configure(), CLComparisonKernel::configure(), NESelectKernel::configure(), CPPDetectionPostProcessLayer::configure(), NEGatherKernel::configure(), NEFuseBatchNormalizationKernel::configure(), NEGEMMMatrixMultiplyKernel::configure(), ClMulKernel::configure(), CLRangeKernel::configure(), CpuMulKernel::configure(), CpuSoftmaxGeneric< IS_LOG >::configure(), CLPriorBoxLayerKernel::configure(), CLBoundingBoxTransformKernel::configure(), NEConvolutionLayerReshapeWeights::configure(), NESoftmaxLayerGeneric< IS_LOG >::configure(), CLGEMMLowpMatrixMultiplyNativeKernel::configure(), NEReduceMean::configure(), CLReduceMean::configure(), CLFillBorderKernel::configure(), CLDepthConvertLayerKernel::configure(), NEFillBorderKernel::configure(), CLDepthwiseConvolutionLayer3x3NHWCKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLGEMMLowpQuantizeDownInt32ScaleKernel::configure(), NEDetectionPostProcessLayer::configure(), CLFuseBatchNormalizationKernel::configure(), CLDeconvolutionLayerUpsample::configure(), CLConvolutionLayerReshapeWeights::configure(), CLGEMMMatrixMultiplyNativeKernel::configure(), CLGEMMLowpMatrixMultiplyReshapedKernel::configure(), CLGEMMMatrixMultiplyKernel::configure(), CLDepthwiseConvolutionLayer3x3NCHWKernel::configure(), NEGEMMAssemblyDispatch::configure(), NEIm2ColKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), NEWinogradConvolutionLayer::configure(), CLArgMinMaxLayer::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), NEGenerateProposalsLayer::configure(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::configure(), CLGEMMLowpMatrixAReductionKernel::configure(), CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLGEMMLowpMatrixMultiplyCore::configure(), CLGenerateProposalsLayer::configure(), NEQLSTMLayer::configure(), CpuComplexMulKernel::configure(), CLGEMMLowpMatrixBReductionKernel::configure(), CLGEMM::configure(), CLQLSTMLayer::configure(), CLGEMMConvolutionLayer::configure(), arm_compute::graph::backends::detail::create_detection_output_layer< CPPDetectionOutputLayer, CLTargetInfo >(), arm_compute::graph::backends::detail::create_detection_post_process_layer< CPPDetectionPostProcessLayer, CLTargetInfo >(), Accessor::data_type(), SubTensorInfo::data_type(), arm_compute::error_on_data_type_not_in(), arm_compute::error_on_mismatching_data_types(), arm_compute::error_on_mismatching_quantization_info(), arm_compute::error_on_unsupported_cpu_bf16(), arm_compute::error_on_unsupported_cpu_fp16(), arm_compute::error_on_unsupported_fp16(), CLDeconvolutionLayer::get_deconvolution_method(), CpuDepthwiseConvolutionAssemblyDispatch::is_optimized_supported(), CaffePreproccessor::preprocess(), TFPreproccessor::preprocess(), CPPUpsampleKernel::run(), NEROIPoolingLayerKernel::run(), CPPBoxWithNonMaximaSuppressionLimitKernel::run(), NEComputeAllAnchorsKernel::run(), CPPTopKVKernel::run(), NEFillBorderKernel::run(), NEBoundingBoxTransformKernel::run(), NEGEMMLowpMatrixMultiplyKernel::run(), CLReductionOperationKernel::run(), NEGEMMMatrixMultiplyKernel::run(), CPPDetectionPostProcessLayer::run(), NEDepthConvertLayerKernel::run(), NEROIAlignLayerKernel::run(), NEBatchNormalizationLayerKernel::run(), NEGEMMLowpOffsetContributionOutputStageKernel::run(), CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::run(), NELSTMLayer::run(), CpuAddKernel::run_op(), CpuSubKernel::run_op(), SubTensorInfo::set_tensor_shape(), CpuDepthwiseConvolutionAssemblyDispatch::validate(), NESelectKernel::validate(), NEConvolutionLayerReshapeWeights::validate(), NEReductionOperation::validate(), CLConvolutionLayerReshapeWeights::validate(), NEDetectionPostProcessLayer::validate(), NEGEMMAssemblyDispatch::validate(), CLArgMinMaxLayer::validate(), CLReductionOperation::validate(), NEGEMM::validate(), NEGenerateProposalsLayer::validate(), NEDeconvolutionLayer::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), CLGEMMLowpMatrixMultiplyCore::validate(), CLGenerateProposalsLayer::validate(), CLDirectDeconvolutionLayer::validate(), ClSaturatedArithmeticKernel::validate(), CLGEMM::validate(), arm_compute::validate(), CLGEMMConvolutionLayer::validate(), NEGEMMLowpOutputStage::validate(), and arm_compute::validate_arguments().

◆ dimension() [1/2]

virtual size_t dimension ( size_t  index) const
pure virtual

Return the size of the requested dimension.

Parameters
[in]indexIndex of the dimension
Returns
Dimension of the requested dimension

Implemented in TensorInfo, and SubTensorInfo.

Referenced by NumPyAccessor::access_tensor(), TopNPredictionsAccessor::access_tensor(), CLComparisonKernel::border_size(), arm_compute::misc::shape_calculator::compute_deconvolution_upsampled_shape(), arm_compute::misc::shape_calculator::compute_interleaved_shape(), arm_compute::misc::shape_calculator::compute_lhs_reshaped_shape(), arm_compute::misc::shape_calculator::compute_mm_shape(), arm_compute::quantization::compute_quantized_multipliers_and_shifts(), arm_compute::misc::shape_calculator::compute_reductionB_shape(), arm_compute::misc::shape_calculator::compute_rhs_reshaped_shape(), arm_compute::misc::shape_calculator::compute_roi_align_shape(), arm_compute::misc::shape_calculator::compute_weights_reshaped_shape(), ClWidthConcatenate2TensorsKernel::configure(), CPPDetectionOutputLayer::configure(), ClWidthConcatenate4TensorsKernel::configure(), CpuDirectConvolutionKernel::configure(), CPPTopKVKernel::configure(), NEComputeAllAnchorsKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), CLBitwiseKernel::configure(), CLChannelShuffleLayerKernel::configure(), CLReverseKernel::configure(), CLSelectKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLComputeAllAnchorsKernel::configure(), CPPBoxWithNonMaximaSuppressionLimitKernel::configure(), ClDirectConvolutionKernel::configure(), NEBoundingBoxTransformKernel::configure(), NEROIPoolingLayerKernel::configure(), CLGatherKernel::configure(), CLSpaceToBatchLayerKernel::configure(), CpuDepthwiseConvolutionNativeKernel::configure(), CLComparisonKernel::configure(), CLTileKernel::configure(), CPPNonMaximumSuppressionKernel::configure(), CPPDetectionPostProcessLayer::configure(), NEGEMMMatrixMultiplyKernel::configure(), CLComparison::configure(), ClMulKernel::configure(), NEROIAlignLayerKernel::configure(), CLRangeKernel::configure(), NEGEMMLowpMatrixMultiplyKernel::configure(), CLPadLayerKernel::configure(), CLPriorBoxLayerKernel::configure(), NEScale::configure(), NERNNLayer::configure(), CLGEMMLowpMatrixMultiplyNativeKernel::configure(), CLFillBorderKernel::configure(), CLROIPoolingLayerKernel::configure(), CLStackLayerKernel::configure(), CLDepthConvertLayerKernel::configure(), CLGEMMReshapeLHSMatrixKernel::configure(), CLDepthwiseConvolutionLayer3x3NHWCKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLWinogradInputTransformKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLCol2ImKernel::configure(), CLRNNLayer::configure(), CLGEMMMatrixMultiplyNativeKernel::configure(), CLGEMMMatrixMultiplyKernel::configure(), CLDepthwiseConvolutionLayer3x3NCHWKernel::configure(), CLGEMMLowpMatrixMultiplyReshapedKernel::configure(), CLGEMMLowpOffsetContributionKernel::configure(), CLWinogradOutputTransformKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), NEWinogradConvolutionLayer::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), NEGenerateProposalsLayer::configure(), CLIm2ColKernel::configure(), NEGEMM::configure(), CLCropResize::configure(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::configure(), CLGEMMLowpMatrixAReductionKernel::configure(), CLComparisonStatic< COP >::configure(), CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::configure(), NEDeconvolutionLayer::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLGEMMLowpMatrixMultiplyCore::configure(), CLGenerateProposalsLayer::configure(), CLGEMMDeconvolutionLayer::configure(), NEQLSTMLayer::configure(), CLDirectDeconvolutionLayer::configure(), NEFullyConnectedLayer::configure(), CLGEMMLowpMatrixBReductionKernel::configure(), CLFullyConnectedLayer::configure(), CLQLSTMLayer::configure(), CLGEMM::configure(), NEGEMMConvolutionLayer::configure(), CLGEMMConvolutionLayer::configure(), NECropKernel::configure_output_shape(), ITensor::copy_from(), NEConvolutionLayer::get_convolution_method(), CLConvolutionLayer::get_convolution_method(), CLDeconvolutionLayer::get_deconvolution_method(), CpuDepthwiseConvolutionAssemblyDispatch::is_optimized_supported(), CPPUpsampleKernel::run(), NEROIPoolingLayerKernel::run(), NETileKernel::run(), NEDepthToSpaceLayerKernel::run(), NESpaceToDepthLayerKernel::run(), CLInstanceNormalizationLayerKernel::run(), CLDeconvolutionLayerUpsampleKernel::run(), CLQLSTMLayerNormalizationKernel::run(), CLROIPoolingLayerKernel::run(), CLMeanStdDevNormalizationKernel::run(), NEFFTRadixStageKernel::run(), NEGEMMLowpMatrixMultiplyKernel::run(), NEGEMMMatrixMultiplyKernel::run(), CLReductionOperationKernel::run(), CLPriorBoxLayerKernel::run(), NEBatchToSpaceLayerKernel::run(), NECropKernel::run(), CLArgMinMaxLayerKernel::run(), NESpaceToBatchLayerKernel::run(), CLDepthwiseConvolutionLayer3x3NHWCKernel::run(), CLROIAlignLayerKernel::run(), NEWeightsReshapeKernel::run(), CLWeightsReshapeKernel::run(), CLComputeMeanVariance::run(), CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::run(), CPPBoxWithNonMaximaSuppressionLimitKernel::run_nmslimit(), CpuDirectConvolutionKernel::run_op(), arm_compute::run_reverse(), CpuDepthwiseConvolutionAssemblyDispatch::validate(), CLDeconvolutionLayerUpsampleKernel::validate(), CPPDetectionPostProcessLayer::validate(), NEConvolutionLayerReshapeWeights::validate(), NERNNLayer::validate(), CLROIPoolingLayerKernel::validate(), CLConvolutionLayerReshapeWeights::validate(), CLRNNLayer::validate(), CpuDirectConvolution::validate(), NEGEMMConv2d::validate(), NEGenerateProposalsLayer::validate(), NEGEMM::validate(), NEWinogradConvolutionLayer::validate(), NEDeconvolutionLayer::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), CLGEMMLowpMatrixMultiplyCore::validate(), CLGEMMDeconvolutionLayer::validate(), CLGenerateProposalsLayer::validate(), CLDirectDeconvolutionLayer::validate(), NEFullyConnectedLayer::validate(), NELSTMLayer::validate(), NEQLSTMLayer::validate(), CLFullyConnectedLayer::validate(), CLGEMM::validate(), CLLSTMLayer::validate(), CLQLSTMLayer::validate(), NEGEMMConvolutionLayer::validate(), CLGEMMConvolutionLayer::validate(), INEWinogradLayerTransformWeightsKernel::validate(), and arm_compute::validate_arguments().

◆ dimension() [2/2]

virtual size_t dimension ( DataLayoutDimension  dimension) const
pure virtual

Return the size of the requested data layout dimension.

Parameters
[in]dimensionDataLayoutDimension of the dimension
Returns
Dimension of the requested dimension

Implemented in TensorInfo, and SubTensorInfo.

◆ element_size()

◆ extend_padding()

virtual bool extend_padding ( const PaddingSize padding)
pure virtual

Update the offset to the first element, the strides and the total size.

Note
This function can only increase the offset, strides and total size.
Parameters
[in]paddingPadding around the XY plane in number of elements.
Returns
True if the strides, offset and total size have changed.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by SubTensorInfo::extend_padding(), NEGEMMConvolutionLayer::run(), arm_compute::test::validation::TEST_CASE(), examples::gemm_tuner_helpers::update_padding_for_cl_image(), arm_compute::cl_gemm::update_padding_for_cl_image(), AccessWindowStatic::update_padding_if_needed(), and AccessWindowRectangle::update_padding_if_needed().

◆ format()

virtual Format format ( ) const
pure virtual

Colour format of the image.

Returns
Colour format of the image

Implemented in TensorInfo, and SubTensorInfo.

Referenced by Accessor::format(), SubTensorInfo::format(), and SubTensorInfo::set_tensor_shape().

◆ get_dynamic_state_value()

static constexpr int32_t get_dynamic_state_value ( )
inlinestatic

Get the value representing dynamic dimension state.

Returns
Value representing dynamic dimension state

Definition at line 49 of file ITensorInfo.h.

50  {
51  return _dynamic_dimension;
52  }

Referenced by arm_compute::test::construct_dynamic_dims_state(), and TensorInfo::is_dynamic().

◆ get_static_state_value()

static constexpr int32_t get_static_state_value ( )
inlinestatic

Get the value representing static dimension state.

Returns
Value representing static dimension state

Definition at line 58 of file ITensorInfo.h.

59  {
60  return _static_dimension;
61  }

Referenced by arm_compute::test::construct_static_dims_state().

◆ has_padding()

virtual bool has_padding ( ) const
pure virtual

Checks if the tensor has been allocated with padding or not.

Returns
True if padding is allocated in the tensor, otherwise false.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by NEPadLayerKernel::configure(), SubTensorInfo::has_padding(), NECropKernel::run(), and NECropKernel::validate().

◆ is_dynamic()

virtual bool is_dynamic ( ) const
pure virtual

Flag indicating whether the shape of the tensor is dynamic, meaning that it can change on kernel/function execution.

Returns
True if its dynamic else false

Implemented in TensorInfo, and SubTensorInfo.

Referenced by SubTensorInfo::is_dynamic().

◆ is_resizable()

◆ num_channels()

◆ num_dimensions()

virtual size_t num_dimensions ( ) const
pure virtual

The number of dimensions of the tensor (rank)

Returns
The number of dimensions of the tensor (rank)

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::misc::shape_calculator::compute_mm_shape(), arm_compute::misc::shape_calculator::compute_stack_shape(), AccessWindowStatic::compute_valid_region(), AccessWindowRectangle::compute_valid_region(), arm_compute::misc::shape_calculator::compute_weights_reshaped_shape(), CLStridedSliceKernel::configure(), CPPDetectionOutputLayer::configure(), CPPUpsampleKernel::configure(), CPPPermuteKernel::configure(), NEPadLayerKernel::configure(), CLGEMMLowpMatrixMultiplyNativeKernel::configure(), NEReduceMean::configure(), CLReduceMean::configure(), CLGEMMMatrixMultiplyNativeKernel::configure(), CLGEMMLowpMatrixMultiplyReshapedKernel::configure(), CLGEMMMatrixMultiplyKernel::configure(), CLGEMMLowpOffsetContributionKernel::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::configure(), CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::configure(), ITensor::copy_from(), arm_compute::error_on_tensor_not_2d(), NEGEMMLowpMatrixMultiplyKernel::run(), NEStackLayerKernel::run(), NEGEMMLowpOffsetContributionKernel::run(), CLGEMMLowpMatrixMultiplyNativeKernel::run(), CLGEMMMatrixMultiplyKernel::run(), CLGEMMLowpMatrixMultiplyReshapedKernel::run(), CLGEMMMatrixMultiplyNativeKernel::run(), NEGEMMLowpOffsetContributionOutputStageKernel::run(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::run(), CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::run(), CLGEMMMatrixMultiplyReshapedKernel::run(), AccessWindowStatic::update_window_if_needed(), AccessWindowRectangle::update_window_if_needed(), NEQLSTMLayerNormalizationKernel::validate(), CpuDepthwiseConvolutionAssemblyDispatch::validate(), NECropKernel::validate(), NEConvolutionLayerReshapeWeights::validate(), NERNNLayer::validate(), CLROIPoolingLayerKernel::validate(), CLConvolutionLayerReshapeWeights::validate(), CLRNNLayer::validate(), CpuDirectConvolution::validate(), NEGEMMConv2d::validate(), NEGenerateProposalsLayer::validate(), NELSTMLayerQuantized::validate(), CLGenerateProposalsLayer::validate(), NEFullyConnectedLayer::validate(), NELSTMLayer::validate(), CLLSTMLayerQuantized::validate(), NEQLSTMLayer::validate(), CLFullyConnectedLayer::validate(), CLLSTMLayer::validate(), CLQLSTMLayer::validate(), NEGEMMConvolutionLayer::validate(), CLGEMMConvolutionLayer::validate(), INEWinogradLayerTransformWeightsKernel::validate(), and arm_compute::validate_arguments().

◆ offset_element_in_bytes()

virtual int32_t offset_element_in_bytes ( const Coordinates pos) const
pure virtual

The offset in bytes from the beginning of the memory allocation to access the element at position (x, y, z ...)

Parameters
[in]posVector with the coordinates of the element to access. The size of this vector must be equal to the number of dimensions of the tensor
Returns
Offset in bytes from the beginning of the memory allocation to access the element (x, y, z, ...)

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::utils::draw_detection_rectangle(), SubTensorInfo::offset_first_element_in_bytes(), ITensor::ptr_to_element(), and NEReorgLayerKernel::run().

◆ offset_first_element_in_bytes()

virtual size_t offset_first_element_in_bytes ( ) const
pure virtual

The offset from the beginning of the memory allocation to the first element of the tensor.

This can be used to access efficiently elements in a 2D tensor

Returns
The offset in bytes to access the first element of the tensor.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by CpuPoolingAssemblyWrapperKernel::run_op(), AccessWindowStatic::update_window_if_needed(), and AccessWindowRectangle::update_window_if_needed().

◆ padding()

◆ quantization_info()

virtual QuantizationInfo quantization_info ( ) const
pure virtual

Get the quantization settings (scale and offset) of the tensor.

Returns
A QuantizationInfo containing the scale and offset.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::cpu::add_qasymm8_neon(), arm_compute::cpu::add_qasymm8_signed_neon(), arm_compute::cpu::add_qsymm16_neon(), arm_compute::auto_init_if_empty(), arm_compute::quantization::compute_quantized_multipliers_and_shifts(), ClWidthConcatenate2TensorsKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), CpuDepthwiseConvolutionAssemblyDispatch::configure(), NEComputeAllAnchorsKernel::configure(), NEQLSTMLayerNormalizationKernel::configure(), NERangeKernel::configure(), CLComputeAllAnchorsKernel::configure(), NEROIPoolingLayerKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), ClDirectConvolutionKernel::configure(), NEBoundingBoxTransformKernel::configure(), CpuDepthwiseConvolutionNativeKernel::configure(), CLComparisonKernel::configure(), CLRangeKernel::configure(), ClMulKernel::configure(), CLBoundingBoxTransformKernel::configure(), NEConvolutionLayerReshapeWeights::configure(), NEReduceMean::configure(), CLROIPoolingLayerKernel::configure(), CLReduceMean::configure(), CLROIAlignLayerKernel::configure(), CLDeconvolutionLayerUpsample::configure(), CLConvolutionLayerReshapeWeights::configure(), CLDepthwiseConvolutionLayer3x3NCHWKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), NEGenerateProposalsLayer::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLGEMMLowpMatrixMultiplyCore::configure(), CLGenerateProposalsLayer::configure(), CLGEMMDeconvolutionLayer::configure(), NEQLSTMLayer::configure(), CLQLSTMLayer::configure(), NEGEMMConvolutionLayer::configure(), CLGEMMConvolutionLayer::configure(), arm_compute::cpu::elementwise_comp_quantized_signed(), arm_compute::cpu::elementwise_op_quantized(), arm_compute::cpu::elementwise_op_quantized_signed(), arm_compute::error_on_mismatching_quantization_info(), arm_compute::cpu::neon_softmax_logits_1d_quantized(), arm_compute::cpu::poolingMxN_q8_neon_nhwc(), Accessor::quantization_info(), SubTensorInfo::quantization_info(), CPPUpsampleKernel::run(), CPPDetectionPostProcessLayer::run(), arm_compute::cpu::sub_qasymm8_neon(), arm_compute::cpu::sub_qasymm8_signed_neon(), arm_compute::cpu::sub_qsymm16_neon(), arm_compute::helpers::tensor_info::tensors_have_different_quantization_info(), CpuDepthwiseConvolutionAssemblyDispatch::validate(), NEGenerateProposalsLayer::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), CLGEMMLowpMatrixMultiplyCore::validate(), CLGenerateProposalsLayer::validate(), NEQLSTMLayer::validate(), arm_compute::validate(), CLQLSTMLayer::validate(), NEGEMMConvolutionLayer::validate(), and CLGEMMConvolutionLayer::validate().

◆ reset_padding()

virtual ITensorInfo& reset_padding ( )
pure virtual

Resets the padding settings of the tensor.

Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by CpuLogits1DSoftmaxKernel< IS_LOG >::configure(), and SubTensorInfo::reset_padding().

◆ set_data_layout()

virtual ITensorInfo& set_data_layout ( const DataLayout data_layout)
pure virtual

Set the data layout of the tensor.

Parameters
[in]data_layoutDataLayout containing the layout data information.
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::auto_init_if_empty(), NEROIAlignLayerKernel::configure(), NEInstanceNormalizationLayer::configure(), CLROIAlignLayerKernel::configure(), NEFFTConvolutionLayer::configure(), NEGEMMConvolutionLayer::configure(), and SubTensorInfo::set_data_layout().

◆ set_data_type()

virtual ITensorInfo& set_data_type ( DataType  data_type)
pure virtual

Set the data type to the specified value.

Warning
This resets the format to UNKNOWN.
Parameters
[in]data_typeThe new data type.
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::auto_init_if_empty(), NEGEMMConvolutionLayer::configure(), SubTensorInfo::set_data_type(), and arm_compute::graph::backends::detail::validate_convolution_layer().

◆ set_format()

virtual ITensorInfo& set_format ( Format  format)
pure virtual

Set the format of an already initialized tensor.

Note
If the data type has already been configured (i.e. not UNKNOWN) it must match the new format. If data type hasn't been configured it will be based on the format.
Parameters
[in]formatSingle-plane format of the tensor.
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by SubTensorInfo::set_format().

◆ set_is_resizable()

virtual ITensorInfo& set_is_resizable ( bool  is_resizable)
pure virtual

Set the flag whether the tensor size can be changed.

Parameters
[in]is_resizableFlag that marks the tensor if it can be changed or not.
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by SubTensorInfo::set_is_resizable().

◆ set_num_channels()

virtual ITensorInfo& set_num_channels ( int  num_channels)
pure virtual

Set the number of channels to the specified value.

Warning
This resets the format to UNKNOWN.
Parameters
[in]num_channelsNew number of channels.
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::auto_init_if_empty(), SubTensorInfo::set_num_channels(), NEReductionOperation::validate(), CLArgMinMaxLayer::validate(), and CLReductionOperation::validate().

◆ set_quantization_info()

◆ set_tensor_dims_state()

virtual ITensorInfo& set_tensor_dims_state ( const TensorDimsState state)
pure virtual

Set the state for each dimension of the tensor.

This sets the state of each dimension of the shape in terms of dynamic behavior using -1 where appropriate. The index in the state is a 1 to 1 mapping with the shape dimension index. For example if you want to express [?, 3, 3] as a dynamic input then [-1, 3, 3] has to be set as a state

Parameters
[in]stateTensor dimensions state
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo.

◆ set_tensor_shape()

virtual ITensorInfo& set_tensor_shape ( const TensorShape shape)
pure virtual

Set the shape of an already initialized tensor.

Warning
Changing the shape requires to recompute the strides and is therefore only possible if the tensor hasn't been allocated yet.
Parameters
[in]shapeNew tensor shape.
Returns
Reference to this ITensorInfo object

Implemented in TensorInfo, and SubTensorInfo.

Referenced by arm_compute::auto_init_if_empty(), NEQLSTMLayer::configure(), NECropKernel::configure_output_shape(), SubTensorInfo::set_tensor_shape(), NEL2NormalizeLayer::validate(), NEReductionOperation::validate(), CLL2NormalizeLayer::validate(), CLArgMinMaxLayer::validate(), and CLReductionOperation::validate().

◆ set_valid_region()

◆ strides_in_bytes()

◆ tensor_dims_state()

virtual const TensorDimsState& tensor_dims_state ( ) const
pure virtual

State of each dimension of the tensor shape.

Returns
A vector with the state for each dimension of the tensor, where -1 specifies dynamic dimension

Implemented in TensorInfo, and SubTensorInfo.

◆ tensor_shape()

virtual const TensorShape& tensor_shape ( ) const
pure virtual

Size for each dimension of the tensor.

Returns
A vector with the size for each dimension of the tensor

Implemented in TensorInfo, and SubTensorInfo.

Referenced by ImageAccessor::access_tensor(), ValidationInputAccessor::access_tensor(), VerifyAccessor< D >::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_s16_u8_s16_neon(), arm_compute::cpu::add_same_neon(), arm_compute::cpu::add_u8_u8_s16_neon(), arm_compute::auto_init_if_empty(), arm_compute::utils::compare_tensor(), arm_compute::misc::shape_calculator::compute_deconvolution_output_shape(), arm_compute::misc::shape_calculator::compute_deep_convolution_shape(), arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), arm_compute::misc::shape_calculator::compute_interleaved_shape(), arm_compute::misc::shape_calculator::compute_lhs_reshaped_shape(), arm_compute::misc::shape_calculator::compute_mm_shape(), arm_compute::misc::shape_calculator::compute_reductionB_shape(), arm_compute::misc::shape_calculator::compute_rhs_reshaped_shape(), arm_compute::misc::shape_calculator::compute_stack_shape(), AccessWindowAutoPadding::compute_valid_region(), AccessWindowStatic::compute_valid_region(), arm_compute::misc::shape_calculator::compute_weights_reshaped_shape(), NELogicalKernel::configure(), CLStridedSliceKernel::configure(), CPPDetectionOutputLayer::configure(), ClSoftmax::configure(), CPPTopKVKernel::configure(), CPPUpsampleKernel::configure(), CLSelectKernel::configure(), NEBitwiseOrKernel::configure(), NEBitwiseAndKernel::configure(), NEBitwiseXorKernel::configure(), CPPPermuteKernel::configure(), CpuSubKernel::configure(), ClLogits1DMaxShiftExpSumKernel::configure(), NEGatherKernel::configure(), NESelectKernel::configure(), NEGEMMMatrixMultiplyKernel::configure(), ClMulKernel::configure(), NEGEMMLowpMatrixMultiplyKernel::configure(), CpuMulKernel::configure(), CpuSoftmaxGeneric< IS_LOG >::configure(), NESoftmaxLayerGeneric< IS_LOG >::configure(), NEReduceMean::configure(), NESpaceToBatchLayer::configure(), NEGEMMLowpOffsetContributionKernel::configure(), CLReduceMean::configure(), CLFillBorderKernel::configure(), NEFillBorderKernel::configure(), CLDepthwiseConvolutionLayer3x3NHWCKernel::configure(), NECropResize::configure(), CLDepthwiseConvolutionLayer3x3NCHWKernel::configure(), CLSpaceToBatchLayer::configure(), CLGEMMLowpOffsetContributionKernel::configure(), CLWinogradOutputTransformKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLGEMMLowpOffsetContributionOutputStageKernel::configure(), NEGEMMLowpOffsetContributionOutputStageKernel::configure(), NEFFTConvolutionLayer::configure(), NEGenerateProposalsLayer::configure(), ClComplexMulKernel::configure(), NEGEMM::configure(), CLCropResize::configure(), CLGEMMLowpMatrixMultiplyReshapedOnlyRHSKernel::configure(), NELSTMLayerQuantized::configure(), NELSTMLayer::configure(), CLWinogradConvolutionLayer::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLFFTConvolutionLayer::configure(), NEQLSTMLayer::configure(), NEFullyConnectedLayer::configure(), CLLSTMLayerQuantized::configure(), CpuComplexMulKernel::configure(), CLFullyConnectedLayer::configure(), CLLSTMLayer::configure(), CLQLSTMLayer::configure(), NEGEMMConvolutionLayer::configure(), NECropKernel::configure_output_shape(), ITensor::copy_from(), arm_compute::graph::backends::detail::create_detection_output_layer< CPPDetectionOutputLayer, CLTargetInfo >(), arm_compute::graph::backends::detail::create_detection_post_process_layer< CPPDetectionPostProcessLayer, CLTargetInfo >(), 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(), SubTensorInfo::extend_padding(), arm_compute::misc::shape_calculator::extract_shape(), Accessor::num_elements(), VerifyAccessor< D >::output_shape(), CLMinMaxLayerKernel::reset(), NEMinMaxLayerKernel::reset(), NETileKernel::run(), NEReorgLayerKernel::run(), CLQLSTMLayerNormalizationKernel::run(), CLComparisonKernel::run(), NEMinMaxLayerKernel::run(), NEStackLayerKernel::run(), NEGEMMLowpOffsetContributionKernel::run(), CLStackLayerKernel::run(), CLCol2ImKernel::run(), CLDepthwiseConvolutionLayer3x3NHWCKernel::run(), CLWinogradFilterTransformKernel::run(), CLDepthwiseConvolutionLayer3x3NCHWKernel::run(), CLWeightsReshapeKernel::run(), CLWinogradOutputTransformKernel::run(), NEGEMMLowpOffsetContributionOutputStageKernel::run(), CLDepthwiseConvolutionLayerNativeKernel::run(), CLIm2ColKernel::run(), SubTensorInfo::set_tensor_shape(), SubTensorInfo::set_valid_region(), Accessor::shape(), 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::cpu::sub_u8_u8_s16_neon(), arm_compute::test::validation::TEST_CASE(), AccessWindowStatic::update_padding_if_needed(), AccessWindowStatic::update_window_if_needed(), AccessWindowRectangle::update_window_if_needed(), NELogicalKernel::validate(), NEQLSTMLayerNormalizationKernel::validate(), CpuDepthwiseConvolutionAssemblyDispatch::validate(), NESelectKernel::validate(), NECropKernel::validate(), NERNNLayer::validate(), CLRNNLayer::validate(), NEPadLayer::validate(), NECropResize::validate(), NEGEMMConv2d::validate(), NEFFTConvolutionLayer::validate(), CLCropResize::validate(), NEDeconvolutionLayer::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), CLWinogradConvolutionLayer::validate(), NELSTMLayerQuantized::validate(), CLFFTConvolutionLayer::validate(), CLGEMMDeconvolutionLayer::validate(), NEFullyConnectedLayer::validate(), CLLSTMLayerQuantized::validate(), CLFullyConnectedLayer::validate(), NEGEMMConvolutionLayer::validate(), CLGEMMConvolutionLayer::validate(), and arm_compute::cl_gemm::validate_image2d_support_on_rhs().

◆ total_size()

virtual size_t total_size ( ) const
pure virtual

Returns the total size of the tensor in bytes.

Returns
Total size of the tensor in bytes.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by CLGEMMConvolutionLayer::configure(), SubTensorInfo::extend_padding(), ITensorV2::get_size(), NEQLSTMLayer::prepare(), CPPUpsampleKernel::run(), CLWinogradOutputTransformKernel::run(), NELSTMLayer::run(), CpuLogits1DSoftmaxKernel< IS_LOG >::run_op(), Accessor::size(), arm_compute::test::validation::TEST_CASE(), SubTensorInfo::total_size(), AccessWindowStatic::update_window_if_needed(), AccessWindowRectangle::update_window_if_needed(), NELogicalKernel::validate(), NEFlattenLayer::validate(), NEQLSTMLayerNormalizationKernel::validate(), CpuDepthwiseConvolutionAssemblyDispatch::validate(), NESelectKernel::validate(), CLFlattenLayer::validate(), NEFFT2D::validate(), NECropKernel::validate(), NEConvolutionLayerReshapeWeights::validate(), NEFFT1D::validate(), CLFFT2D::validate(), CLFFT1D::validate(), CLROIPoolingLayerKernel::validate(), CLConvolutionLayerReshapeWeights::validate(), NEPadLayer::validate(), NECropResize::validate(), CLArgMinMaxLayer::validate(), CLReductionOperation::validate(), NEGenerateProposalsLayer::validate(), NEGEMM::validate(), NEFFTConvolutionLayer::validate(), CLCropResize::validate(), CLGEMMLowpMatrixMultiplyCore::validate(), NELSTMLayerQuantized::validate(), CLFFTConvolutionLayer::validate(), CLGenerateProposalsLayer::validate(), CLLSTMLayerQuantized::validate(), NEQLSTMLayer::validate(), CLQLSTMLayer::validate(), CLGEMMConvolutionLayer::validate(), and arm_compute::validate_arguments().

◆ valid_region()

virtual ValidRegion valid_region ( ) const
pure virtual

Valid region of the tensor.

All elements in the valid region have defined values, i.e. are not undefined.

Returns
The valid region.

Implemented in TensorInfo, and SubTensorInfo.

Referenced by CLFillBorderKernel::configure(), arm_compute::cpu::neon_softmax_logits_1d_float(), arm_compute::cpu::neon_softmax_logits_1d_quantized(), and SubTensorInfo::set_valid_region().


The documentation for this class was generated from the following file: