21.08
|
Interface for CPU tensor. More...
#include <ITensor.h>
Public Member Functions | |
virtual ITensorInfo * | info () const =0 |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
virtual ITensorInfo * | info ()=0 |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
virtual | ~ITensor ()=default |
Default virtual destructor. More... | |
virtual uint8_t * | buffer () const =0 |
Interface to be implemented by the child class to return a pointer to CPU memory. More... | |
uint8_t * | ptr_to_element (const Coordinates &id) const |
Return a pointer to the element at the passed coordinates. More... | |
void | copy_from (const ITensor &src) |
Copy the content of another tensor. More... | |
void | print (std::ostream &s, IOFormatInfo io_fmt=IOFormatInfo()) const |
Print a tensor to a given stream using user defined formatting information. More... | |
bool | is_used () const |
Flags if the tensor is used or not. More... | |
void | mark_as_unused () const |
Marks a tensor as unused. More... | |
void | mark_as_used () const |
Marks a tensor as used. More... | |
|
virtualdefault |
Default virtual destructor.
|
pure virtual |
Interface to be implemented by the child class to return a pointer to CPU memory.
Implemented in ICLTensor, SubTensor, OperatorTensor, and Tensor.
Referenced by ValidationOutputAccessor::access_tensor(), SubTensor::buffer(), NEMaxUnpoolingLayerKernel::configure(), ITensor::copy_from(), CpuAuxTensorHandler::CpuAuxTensorHandler(), Accessor::data(), DetectionOutputAccessor::DetectionOutputAccessor(), arm_compute::utils::draw_detection_rectangle(), Iterator::Iterator(), arm_compute::cpu::nearest_neon_scale(), CpuDepthwiseConv2dAssemblyDispatch::prepare(), ITensor::ptr_to_element(), RandomAccessor::RandomAccessor(), CPPUpsampleKernel::run(), NEROIPoolingLayerKernel::run(), NEReorgLayerKernel::run(), NEROIAlignLayerKernel::run(), CpuGemmConvolution::run(), CpuConcatenateHeightKernel::run_op(), CpuConcatenateWidthKernel::run_op(), CpuDepthwiseConv2dAssemblyWrapperKernel::run_op(), CpuPool2dAssemblyWrapperKernel::run_op(), CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run_op(), CpuWinogradConv2dTransformOutputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run_op(), CpuWinogradConv2dTransformWeightsKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run_op(), arm_compute::run_reverse(), TopNPredictionsAccessor::TopNPredictionsAccessor(), NEFFTDigitReverseKernel::validate(), and NEBoundingBoxTransformKernel::validate().
void copy_from | ( | const ITensor & | src | ) |
Copy the content of another tensor.
[in] | src | Source tensor to copy from. |
Definition at line 35 of file ITensor.cpp.
References IOFormatInfo::align_columns, ValidRegion::anchor, ARM_COMPUTE_ERROR_ON, BorderSize::bottom, ITensor::buffer(), ITensorInfo::data_type(), IOFormatInfo::Default, ITensorInfo::dimension(), Window::DimY, dt, IOFormatInfo::element_delim, ITensorInfo::element_size(), arm_compute::execute_window_loop(), IOFormatInfo::Full, ITensor::info(), arm_compute::is_data_type_float(), BorderSize::left, IOFormatInfo::NoPadding, ITensorInfo::num_channels(), ITensorInfo::num_dimensions(), offset(), ITensorInfo::offset_element_in_bytes(), ITensorInfo::offset_first_element_in_bytes(), ITensorInfo::padding(), IOFormatInfo::precision, IOFormatInfo::precision_type, ITensor::print(), IOFormatInfo::print_region, Iterator::ptr(), BorderSize::right, IOFormatInfo::row_delim, ITensorInfo::set_valid_region(), ValidRegion::shape, arm_compute::test::validation::src_info, ITensorInfo::strides_in_bytes(), ITensorInfo::tensor_shape(), BorderSize::top, TensorShape::total_size_upper(), Window::use_tensor_dimensions(), arm_compute::test::validation::valid_region, ITensorInfo::valid_region(), IOFormatInfo::ValidRegion, Dimensions< T >::x(), and Dimensions< T >::y().
Referenced by ITensor::ptr_to_element().
|
pure virtual |
Interface to be implemented by the child class to return the tensor's metadata.
Implemented in CLSubTensor, CLTensor, SubTensor, OperatorTensor, and Tensor.
Referenced by NumPyAccessor::access_tensor(), ImageAccessor::access_tensor(), ValidationInputAccessor::access_tensor(), ValidationOutputAccessor::access_tensor(), VerifyAccessor< D >::access_tensor(), DetectionOutputAccessor::access_tensor(), TopNPredictionsAccessor::access_tensor(), RandomAccessor::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(), ICLKernel::add_tensor_argument(), arm_compute::cpu::bilinear_neon_scale(), CLComparisonKernel::border_size(), CLAuxTensorHandler::CLAuxTensorHandler(), ICLTensor::clear(), CLQLSTMLayer::CLQLSTMLayer(), CLSubTensor::CLSubTensor(), arm_compute::colorconvert_iyuv_to_rgb(), arm_compute::colorconvert_nv12_to_rgb(), arm_compute::utils::compare_tensor(), CPPDetectionOutputLayer::configure(), CpuScaleKernel::configure(), ICLSimpleKernel::configure(), NEReverseKernel::configure(), NETileKernel::configure(), NEBatchToSpaceLayerKernel::configure(), NEChannelShuffleLayerKernel::configure(), NEDepthToSpaceLayerKernel::configure(), CLFillBorderKernel::configure(), NEPriorBoxLayerKernel::configure(), NESpaceToDepthLayerKernel::configure(), NEComputeAllAnchorsKernel::configure(), NEInstanceNormalizationLayerKernel::configure(), NEReorgLayerKernel::configure(), CPPTopKVKernel::configure(), CLRemapKernel::configure(), NEBitwiseNotKernel::configure(), NEFFTDigitReverseKernel::configure(), NEFFTScaleKernel::configure(), CPPUpsampleKernel::configure(), NEQLSTMLayerNormalizationKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), NESpaceToBatchLayerKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), CLMinMaxLayerKernel::configure(), CLBitwiseKernel::configure(), CLReverseKernel::configure(), NEBitwiseAndKernel::configure(), NEBitwiseOrKernel::configure(), NEBitwiseXorKernel::configure(), CLSelectKernel::configure(), NENormalizationLayerKernel::configure(), CPPPermuteKernel::configure(), CLChannelShuffleLayerKernel::configure(), CPPBoxWithNonMaximaSuppressionLimit::configure(), CLDepthToSpaceLayerKernel::configure(), CLSpaceToDepthLayerKernel::configure(), NEPadLayerKernel::configure(), CLBatchToSpaceLayerKernel::configure(), NEMaxUnpoolingLayerKernel::configure(), CLComputeAllAnchorsKernel::configure(), NERangeKernel::configure(), NERemapKernel::configure(), CLDeconvolutionLayerUpsampleKernel::configure(), NEBoundingBoxTransformKernel::configure(), CLSpaceToBatchLayerKernel::configure(), NEFlattenLayer::configure(), NEFFTRadixStageKernel::configure(), CPPBoxWithNonMaximaSuppressionLimitKernel::configure(), CLFFTScaleKernel::configure(), NEReshapeLayer::configure(), NEMeanStdDevNormalizationKernel::configure(), CLGatherKernel::configure(), NEROIPoolingLayerKernel::configure(), CLNormalizationLayerKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), NEFill::configure(), CLTileKernel::configure(), NEFillBorderKernel::configure(), NEMinMaxLayerKernel::configure(), NEStackLayerKernel::configure(), CLComparisonKernel::configure(), CLReorgLayerKernel::configure(), CPPDetectionPostProcessLayer::configure(), NECopy::configure(), CLFFTDigitReverseKernel::configure(), NEGatherKernel::configure(), CPPNonMaximumSuppressionKernel::configure(), NETranspose::configure(), NEReductionOperationKernel::configure(), NESelectKernel::configure(), NELogicalAnd::configure(), NEFuseBatchNormalizationKernel::configure(), NEQuantizationLayer::configure(), CLMeanStdDevNormalizationKernel::configure(), CLComparison::configure(), NECropKernel::configure(), NEROIAlignLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLRangeKernel::configure(), CLReductionOperationKernel::configure(), NEBatchNormalizationLayerKernel::configure(), NEDequantizationLayer::configure(), CLPadLayerKernel::configure(), NESlice::configure(), CLFFTRadixStageKernel::configure(), NEPermute::configure(), CLPriorBoxLayerKernel::configure(), NEFFT2D::configure(), NEPReluLayer::configure(), CLL2NormalizeLayerKernel::configure(), CLReshapeLayer::configure(), NEUnstack::configure(), NEStridedSlice::configure(), CLBoundingBoxTransformKernel::configure(), NEElementwiseMax::configure(), NEReduceMean::configure(), NERNNLayer::configure(), NEScale::configure(), NESpaceToBatchLayer::configure(), CLUnstack::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), NESoftmaxLayerGeneric< IS_LOG >::configure(), CLRsqrtLayer::configure(), CLFlattenLayer::configure(), CLROIPoolingLayerKernel::configure(), CLStackLayerKernel::configure(), CLReduceMean::configure(), NECropResize::configure(), NEGEMM::configure(), NEFFT1D::configure(), NEReductionOperation::configure(), CLArgMinMaxLayerKernel::configure(), CLLogicalAnd::configure(), CLLogicalNot::configure(), CLLogicalOr::configure(), NEInstanceNormalizationLayer::configure(), CLROIAlignLayerKernel::configure(), NEPoolingLayer::configure(), NEDetectionPostProcessLayer::configure(), NEGEMMLowpOutputStage::configure(), NENormalizationLayer::configure(), CLDequantizationLayer::configure(), CLDeconvolutionReshapeOutputKernel::configure(), NEArithmeticSubtraction::configure(), CLFFT2D::configure(), NEDepthwiseConvolutionLayer::configure(), CLDeconvolutionLayer::configure(), CLPReluLayer::configure(), CLPoolingLayer::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLRNNLayer::configure(), CLDeconvolutionLayerUpsample::configure(), CLFFT1D::configure(), CLFullyConnectedLayer::configure(), NEPadLayer::configure(), CLScale::configure(), CLSpaceToBatchLayer::configure(), NEDirectConvolutionLayer::configure(), CLSlice::configure(), CLQuantizationLayer::configure(), NEGEMMConv2d::configure(), NEWinogradConvolutionLayer::configure(), CLDepthwiseConvolutionLayer::configure(), CLSoftmaxLayerGeneric< IS_LOG >::configure(), CLGEMM::configure(), CLPadLayer::configure(), CLReductionOperation::configure(), CLArgMinMaxLayer::configure(), NEPixelWiseMultiplication::configure(), CLDirectConvolutionLayer::configure(), NEFFTConvolutionLayer::configure(), NEGEMMConvolutionLayer::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLGEMMLowpOutputStage::configure(), NEGenerateProposalsLayer::configure(), CLPixelWiseMultiplication::configure(), CLCropResize::configure(), NELSTMLayerQuantized::configure(), CLWinogradConvolutionLayer::configure(), NELSTMLayer::configure(), CLComputeMeanVariance::configure(), CLArithmeticAddition::configure(), CLComparisonStatic< COP >::configure(), CLGEMMLowpMatrixMultiplyCore::configure(), NEDeconvolutionLayer::configure(), CLFFTConvolutionLayer::configure(), CLGEMMConvolutionLayer::configure(), NELogicalOr::configure(), NEConvolutionLayer::configure(), CLGenerateProposalsLayer::configure(), NEFullyConnectedLayer::configure(), CLGEMMDeconvolutionLayer::configure(), CLDirectDeconvolutionLayer::configure(), CLLSTMLayerQuantized::configure(), NEQLSTMLayer::configure(), CLExpLayer::configure(), NEElementwiseMin::configure(), CLConvolutionLayer::configure(), NEComplexPixelWiseMultiplication::configure(), CLComplexPixelWiseMultiplication::configure(), NELogicalNot::configure(), CLLSTMLayer::configure(), CLQLSTMLayer::configure(), CLNegLayer::configure(), NEElementwiseSquaredDiff::configure(), CLArithmeticSubtraction::configure(), CLSinLayer::configure(), NEElementwiseDivision::configure(), CLLogLayer::configure(), CLArithmeticDivision::configure(), NEElementwisePower::configure(), CLAbsLayer::configure(), NEElementwiseComparison::configure(), CLElementwiseMax::configure(), CLRoundLayer::configure(), NEElementwiseComparisonStatic< op >::configure(), CLElementwiseMin::configure(), CLElementwiseSquaredDiff::configure(), CLElementwisePower::configure(), NECropKernel::configure_output_shape(), ITensor::copy_from(), CpuAuxTensorHandler::CpuAuxTensorHandler(), Accessor::data_layout(), Accessor::data_type(), DetectionOutputAccessor::DetectionOutputAccessor(), arm_compute::utils::draw_detection_rectangle(), Accessor::element_size(), 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::error_on_data_layout_not_in(), arm_compute::error_on_data_type_channel_not_in(), arm_compute::error_on_data_type_not_in(), arm_compute::error_on_mismatching_data_layouts(), arm_compute::error_on_mismatching_data_types(), arm_compute::error_on_mismatching_quantization_info(), arm_compute::error_on_mismatching_shapes(), arm_compute::error_on_tensor_not_2d(), arm_compute::error_on_unsupported_cpu_bf16(), arm_compute::error_on_unsupported_cpu_fp16(), arm_compute::error_on_unsupported_fp16(), Accessor::format(), arm_compute::graph::backends::detail::get_backing_tensor_info(), ITensorV2::get_size(), Iterator::Iterator(), arm_compute::cpu::nearest_neon_scale(), NEGatherKernel::NEGatherKernel(), arm_compute::cpu::neon_softmax_logits_1d_float(), arm_compute::cpu::neon_softmax_logits_1d_quantized(), NEPadLayer::NEPadLayer(), Accessor::num_channels(), Accessor::num_elements(), NumPyAccessor::NumPyAccessor(), get_tensor_info_t< ITensorInfo * >::operator()(), VerifyAccessor< D >::output_shape(), Accessor::padding(), arm_compute::cpu::poolingMxN_fp32_neon_nhwc(), arm_compute::cpu::poolingMxN_q8_neon_nhwc(), CpuDepthwiseConv2dAssemblyDispatch::prepare(), ClGemmLowpMatrixMultiplyCore::prepare(), CLDepthwiseConvolutionLayer::prepare(), CaffePreproccessor::preprocess(), TFPreproccessor::preprocess(), ITensor::ptr_to_element(), arm_compute::cpu::qasymm8_neon_activation(), arm_compute::cpu::qasymm8_signed_neon_activation(), arm_compute::cpu::qsymm16_neon_activation(), Accessor::quantization_info(), RandomAccessor::RandomAccessor(), CLMinMaxLayerKernel::reset(), NEMinMaxLayerKernel::reset(), arm_compute::roi_align_1x1(), arm_compute::roi_align_1x1_qasymm8(), CpuElementwiseBase::run(), CpuElementwiseUnary::run(), CPPUpsampleKernel::run(), CPPDetectionOutputLayer::run(), NEROIPoolingLayerKernel::run(), CPPBoxWithNonMaximaSuppressionLimitKernel::run(), NETileKernel::run(), NEChannelShuffleLayerKernel::run(), NEReverseKernel::run(), NESpaceToDepthLayerKernel::run(), NEDepthToSpaceLayerKernel::run(), NEComputeAllAnchorsKernel::run(), CLInstanceNormalizationLayerKernel::run(), CPPTopKVKernel::run(), NEReorgLayerKernel::run(), CLDeconvolutionLayerUpsampleKernel::run(), CLQLSTMLayerNormalizationKernel::run(), CLROIPoolingLayerKernel::run(), CLComparisonKernel::run(), NEFillBorderKernel::run(), NEMinMaxLayerKernel::run(), CLMeanStdDevNormalizationKernel::run(), NEFFTRadixStageKernel::run(), NEBoundingBoxTransformKernel::run(), NEStackLayerKernel::run(), CLReductionOperationKernel::run(), CLPriorBoxLayerKernel::run(), CPPDetectionPostProcessLayer::run(), NEBatchToSpaceLayerKernel::run(), NEROIAlignLayerKernel::run(), NECropKernel::run(), NEBatchNormalizationLayerKernel::run(), CLStackLayerKernel::run(), CLArgMinMaxLayerKernel::run(), CLDepthwiseConvolutionLayerNativeKernel::run(), NESpaceToBatchLayerKernel::run(), ClGemm::run(), CLROIAlignLayerKernel::run(), CLComputeMeanVariance::run(), CpuGemmConvolution::run(), CPPBoxWithNonMaximaSuppressionLimitKernel::run_nmslimit(), CpuPool2dKernel::run_op(), CpuDirectConv2dKernel::run_op(), CpuCastKernel::run_op(), CpuGemmLowpOffsetContributionKernel::run_op(), CpuDepthwiseConv2dAssemblyWrapperKernel::run_op(), CpuCol2ImKernel::run_op(), CpuPool2dAssemblyWrapperKernel::run_op(), NEFillBorderKernel::run_op(), CpuWeightsReshapeKernel::run_op(), CpuGemmTranspose1xWKernel::run_op(), CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run_op(), CpuWinogradConv2dTransformOutputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::run_op(), arm_compute::run_reverse(), Accessor::shape(), Accessor::size(), 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(), SubTensor::SubTensor(), TopNPredictionsAccessor::TopNPredictionsAccessor(), CpuQuantizeKernel::validate(), CpuGemmLowpMatrixAReductionKernel::validate(), CpuDepthwiseConv2dNativeKernel::validate(), NEComputeAllAnchorsKernel::validate(), NEFFTDigitReverseKernel::validate(), NEBoundingBoxTransformKernel::validate(), CLReductionOperation::validate(), and CpuGemmLowpMatrixBReductionKernel::validate().
|
pure virtual |
Interface to be implemented by the child class to return the tensor's metadata.
Implemented in CLSubTensor, CLTensor, SubTensor, OperatorTensor, and Tensor.
bool is_used | ( | ) | const |
Flags if the tensor is used or not.
Definition at line 163 of file ITensor.cpp.
Referenced by CLFullyConnectedLayer::prepare(), CLDepthwiseConvolutionLayer::prepare(), NEFFTConvolutionLayer::prepare(), NEDeconvolutionLayer::prepare(), NEFullyConnectedLayer::prepare(), CLFFTConvolutionLayer::prepare(), CLGEMMDeconvolutionLayer::prepare(), CLDirectDeconvolutionLayer::prepare(), ITensor::ptr_to_element(), CLTensorHandle::release_if_unused(), and NETensorHandle::release_if_unused().
void mark_as_unused | ( | ) | const |
Marks a tensor as unused.
Definition at line 168 of file ITensor.cpp.
Referenced by CpuDepthwiseConv2dAssemblyDispatch::prepare(), ClFullyConnected::prepare(), CpuFullyConnected::prepare(), CLDepthwiseConvolutionLayer::prepare(), NEFFTConvolutionLayer::prepare(), NEDeconvolutionLayer::prepare(), CLFFTConvolutionLayer::prepare(), CLGEMMDeconvolutionLayer::prepare(), NELSTMLayerQuantized::prepare(), CLDirectDeconvolutionLayer::prepare(), CLLSTMLayerQuantized::prepare(), NEQLSTMLayer::prepare(), CLQLSTMLayer::prepare(), ITensor::ptr_to_element(), IWeightsManager::release(), and IWeightsManager::run().
void mark_as_used | ( | ) | const |
Marks a tensor as used.
Definition at line 173 of file ITensor.cpp.
Referenced by ITensor::ptr_to_element().
void print | ( | std::ostream & | s, |
IOFormatInfo | io_fmt = IOFormatInfo() |
||
) | const |
Print a tensor to a given stream using user defined formatting information.
s | Output stream |
io_fmt | Format information |
Referenced by NumPyAccessor::access_tensor(), ITensor::copy_from(), arm_compute::graph::execute_task(), main(), and ITensor::ptr_to_element().
|
inline |
Return a pointer to the element at the passed coordinates.
[in] | id | Coordinates of the element |
Definition at line 63 of file ITensor.h.
References ITensor::buffer(), ITensor::copy_from(), ITensor::info(), ITensor::is_used(), ITensor::mark_as_unused(), ITensor::mark_as_used(), ITensorInfo::offset_element_in_bytes(), ITensor::print(), and arm_compute::test::validation::src.
Referenced by arm_compute::cpu::bilinear_neon_scale(), CpuScaleKernel::configure(), NECropKernel::configure_output_shape(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::cpu::nearest_neon_scale(), NEGatherKernel::NEGatherKernel(), Accessor::operator()(), CLAccessor::operator()(), arm_compute::cpu::poolingMxN_q8_neon_nhwc(), ClGemmLowpMatrixMultiplyCore::prepare(), CLDepthwiseConvolutionLayer::prepare(), CaffePreproccessor::preprocess(), TFPreproccessor::preprocess(), RandomAccessor::RandomAccessor(), arm_compute::roi_align_1x1(), arm_compute::roi_align_1x1_qasymm8(), CPPDetectionOutputLayer::run(), NETileKernel::run(), NESpaceToDepthLayerKernel::run(), NEDepthToSpaceLayerKernel::run(), CPPNonMaximumSuppressionKernel::run(), CPPDetectionPostProcessLayer::run(), NEROIAlignLayerKernel::run(), NEBatchToSpaceLayerKernel::run(), NECropKernel::run(), NESpaceToBatchLayerKernel::run(), NECropResize::run(), CPPBoxWithNonMaximaSuppressionLimitKernel::run_nmslimit(), NEFillBorderKernel::run_op(), arm_compute::run_reverse(), and NEComputeAllAnchorsKernel::validate().