21.02
|
Store the tensor's metadata. More...
#include <TensorInfo.h>
Public Member Functions | |
TensorInfo () | |
Default constructor. More... | |
~TensorInfo ()=default | |
Default destructor. More... | |
TensorInfo (const ITensorInfo &info) | |
Allow instances of this class to be copy constructed. More... | |
TensorInfo (const TensorInfo &)=default | |
Allow instances of this class to be copy constructed. More... | |
TensorInfo & | operator= (const TensorInfo &)=default |
Allow instances of this class to be copied. More... | |
TensorInfo (TensorInfo &&)=default | |
Allow instances of this class to be move constructed. More... | |
TensorInfo & | operator= (TensorInfo &&)=default |
Allow instances of this class to be moved. More... | |
TensorInfo (Format format) | |
Construct a tensor info with a format. More... | |
TensorInfo (unsigned int width, unsigned int height, Format format) | |
2D tensor constructor More... | |
TensorInfo (const TensorShape &tensor_shape, Format format) | |
Constructor. More... | |
TensorInfo (size_t num_channels, DataType data_type) | |
Construct a tensor info with a data type and number of channels. More... | |
TensorInfo (const TensorShape &tensor_shape, size_t num_channels, DataType data_type) | |
Constructor. More... | |
TensorInfo (const TensorShape &tensor_shape, size_t num_channels, DataType data_type, DataLayout data_layout) | |
Constructor. More... | |
TensorInfo (const TensorShape &tensor_shape, size_t num_channels, DataType data_type, QuantizationInfo quantization_info) | |
Constructor. More... | |
TensorInfo (const HOGInfo &hog_info, unsigned int width, unsigned int height) | |
Constructor. More... | |
void | init (Format format) |
Initialize the tensor info with just a format. More... | |
void | init (const TensorShape &tensor_shape, Format format) |
Initialize the metadata structure with the given parameters. More... | |
void | init (const TensorShape &tensor_shape, Format format, const Strides &strides_in_bytes, size_t offset_first_element_in_bytes, size_t total_size_in_bytes) |
Initialize the metadata structure with the given parameters. More... | |
void | init (size_t num_channels, DataType data_type) |
Initialize the tensor info with just a format. More... | |
void | init (const TensorShape &tensor_shape, size_t num_channels, DataType data_type) |
Initialize the metadata structure with the given parameters. More... | |
void | init (const TensorShape &tensor_shape, size_t num_channels, DataType data_type, const Strides &strides_in_bytes, size_t offset_first_element_in_bytes, size_t total_size_in_bytes) |
Initialize the metadata structure with the given parameters. More... | |
void | init (const HOGInfo &hog_info, unsigned int width, unsigned int height) |
Initialize the metadata structure for the given HOG's metadata. More... | |
size_t | init_auto_padding (const TensorShape &tensor_shape, Format format) |
Initialize the metadata structure for the given tensor shape and single-plane format, (Padding is automatically calculated) More... | |
size_t | init_auto_padding (const TensorShape &tensor_shape, size_t num_channels, DataType data_type) |
Initialize the metadata structure for the given tensor shape, number of channels and data type. More... | |
size_t | init_auto_padding (const HOGInfo &hog_info, unsigned int width, unsigned int height) |
Initialize the metadata structure for the given HOG's metadata. More... | |
std::unique_ptr< ITensorInfo > | clone () const override |
Provide a clone of the current object of class T. More... | |
ITensorInfo & | set_data_type (DataType data_type) override |
Set the data type to the specified value. More... | |
ITensorInfo & | set_num_channels (int num_channels) override |
Set the number of channels to the specified value. More... | |
ITensorInfo & | set_format (Format format) override |
Set the format of an already initialized tensor. More... | |
ITensorInfo & | set_tensor_shape (const TensorShape &shape) override |
Set the shape of an already initialized tensor. More... | |
ITensorInfo & | set_tensor_dims_state (const TensorDimsState &state) override |
Set the state for each dimension of the tensor. More... | |
ITensorInfo & | set_quantization_info (const QuantizationInfo &quantization_info) override |
Set the quantization settings (scale and offset) of the tensor. More... | |
ITensorInfo & | set_data_layout (const DataLayout &data_layout) override |
Set the data layout of the tensor. More... | |
ITensorInfo & | reset_padding () override |
Resets the padding settings of the tensor. More... | |
bool | auto_padding () override |
Update the offset to the first element and the strides to automatically computed values. More... | |
bool | extend_padding (const PaddingSize &padding) override |
Update the offset to the first element, the strides and the total size. More... | |
size_t | dimension (size_t index) const override |
Return the size of the requested dimension. More... | |
size_t | dimension (DataLayoutDimension dimension) const override |
Return the size of the requested data layout dimension. More... | |
const Strides & | strides_in_bytes () const override |
The strides in bytes for accessing each dimension of the tensor. More... | |
size_t | offset_first_element_in_bytes () const override |
The offset from the beginning of the memory allocation to the first element of the tensor. More... | |
int32_t | offset_element_in_bytes (const Coordinates &pos) const override |
The offset in bytes from the beginning of the memory allocation to access the element at position (x, y, z ...) More... | |
size_t | element_size () const override |
Element size in bytes calculated as data_size() * num_channels() More... | |
size_t | num_dimensions () const override |
The number of dimensions of the tensor (rank) More... | |
size_t | num_channels () const override |
The number of channels for each tensor element. More... | |
const TensorShape & | tensor_shape () const override |
Size for each dimension of the tensor. More... | |
const TensorDimsState & | tensor_dims_state () const override |
State of each dimension of the tensor shape. More... | |
DataType | data_type () const override |
Data type used for each element of the tensor. More... | |
Format | format () const override |
Colour format of the image. More... | |
size_t | total_size () const override |
Returns the total size of the tensor in bytes. More... | |
PaddingSize | padding () const override |
Padding of tensor. More... | |
bool | has_padding () const override |
Checks if the tensor has been allocated with padding or not. More... | |
bool | is_resizable () const override |
Flag indicating whether the size of the tensor can be changed. More... | |
bool | is_dynamic () const override |
Flag indicating whether the shape of the tensor is dynamic, meaning that it can change on kernel/function execution. More... | |
ITensorInfo & | set_is_resizable (bool is_resizable) override |
Set the flag whether the tensor size can be changed. More... | |
ValidRegion | valid_region () const override |
Valid region of the tensor. More... | |
void | set_valid_region (const ValidRegion &valid_region) override |
Set the valid region of the tensor. More... | |
QuantizationInfo | quantization_info () const override |
Get the quantization settings (scale and offset) of the tensor. More... | |
DataLayout | data_layout () const override |
Get the data layout of the tensor. More... | |
Public Member Functions inherited from ITensorInfo | |
virtual | ~ITensorInfo ()=default |
Default virtual destructor. More... | |
Public Member Functions inherited from ICloneable< ITensorInfo > | |
virtual | ~ICloneable ()=default |
Default virtual desctructor. More... | |
Additional Inherited Members | |
Public Types inherited from ITensorInfo | |
using | TensorDimsState = Coordinates |
Static Public Member Functions inherited from ITensorInfo | |
template<typename... Infos> | |
static std::pair< TensorShape, ValidRegion > | broadcast_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... | |
Store the tensor's metadata.
Definition at line 45 of file TensorInfo.h.
TensorInfo | ( | ) |
Default constructor.
Definition at line 37 of file TensorInfo.cpp.
References arm_compute::NCHW, and arm_compute::UNKNOWN.
|
default |
Default destructor.
TensorInfo | ( | const ITensorInfo & | info | ) |
Allow instances of this class to be copy constructed.
Definition at line 43 of file TensorInfo.cpp.
References ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::format(), ITensorInfo::is_resizable(), ITensorInfo::num_channels(), ITensorInfo::offset_first_element_in_bytes(), ITensorInfo::padding(), ITensorInfo::quantization_info(), ITensorInfo::strides_in_bytes(), ITensorInfo::tensor_dims_state(), ITensorInfo::tensor_shape(), ITensorInfo::total_size(), and ITensorInfo::valid_region().
|
default |
Allow instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
TensorInfo | ( | Format | format | ) |
Construct a tensor info with a format.
Can be used for automatic derivation of the shape by the function.
[in] | format | Format of the tensor. |
Definition at line 61 of file TensorInfo.cpp.
TensorInfo | ( | unsigned int | width, |
unsigned int | height, | ||
Format | format | ||
) |
2D tensor constructor
[in] | width | Width of the 2D tensor |
[in] | height | Height of the 2D tensor |
[in] | format | Single plane format of the tensor. |
Definition at line 66 of file TensorInfo.cpp.
TensorInfo | ( | const TensorShape & | tensor_shape, |
Format | format | ||
) |
Constructor.
[in] | tensor_shape | It specifies the size for each dimension of the tensor in number of elements. |
[in] | format | Single plane format of the tensor. |
Definition at line 71 of file TensorInfo.cpp.
References TensorInfo::init().
TensorInfo | ( | size_t | num_channels, |
DataType | data_type | ||
) |
Construct a tensor info with a data type and number of channels.
Can be used for automatic derivation of the shape by the function.
[in] | num_channels | It indicates the number of channels for each tensor element |
[in] | data_type | Data type to use for each tensor element |
Definition at line 77 of file TensorInfo.cpp.
References TensorInfo::init().
TensorInfo | ( | const TensorShape & | tensor_shape, |
size_t | num_channels, | ||
DataType | data_type | ||
) |
Constructor.
[in] | tensor_shape | It specifies the size for each dimension of the tensor in number of elements. |
[in] | num_channels | It indicates the number of channels for each tensor element |
[in] | data_type | Data type to use for each tensor element |
Definition at line 83 of file TensorInfo.cpp.
References TensorInfo::init().
TensorInfo | ( | const TensorShape & | tensor_shape, |
size_t | num_channels, | ||
DataType | data_type, | ||
DataLayout | data_layout | ||
) |
Constructor.
[in] | tensor_shape | It specifies the size for each dimension of the tensor in number of elements. |
[in] | num_channels | It indicates the number of channels for each tensor element |
[in] | data_type | Data type to use for each tensor element |
[in] | data_layout | The data layout setting for the tensor data. |
Definition at line 96 of file TensorInfo.cpp.
References TensorInfo::data_layout(), and TensorInfo::init().
TensorInfo | ( | const TensorShape & | tensor_shape, |
size_t | num_channels, | ||
DataType | data_type, | ||
QuantizationInfo | quantization_info | ||
) |
Constructor.
[in] | tensor_shape | It specifies the size for each dimension of the tensor in number of elements. |
[in] | num_channels | It indicates the number of channels for each tensor element |
[in] | data_type | Data type to use for each tensor element |
[in] | quantization_info | The quantization settings for the tensor data. |
Definition at line 89 of file TensorInfo.cpp.
References TensorInfo::init().
TensorInfo | ( | const HOGInfo & | hog_info, |
unsigned int | width, | ||
unsigned int | height | ||
) |
Constructor.
[in] | hog_info | HOG's metadata used to allocate normalized HOG space |
[in] | width | Width of the 2D tensor where the HOG descriptor will be computed on |
[in] | height | Height of the 2D tensor where the HOG descriptor will be computed on |
Definition at line 103 of file TensorInfo.cpp.
References TensorInfo::init().
|
overridevirtual |
Update the offset to the first element and the strides to automatically computed values.
Implements ITensorInfo.
Definition at line 224 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, BorderSize::bottom, arm_compute::compute_strides(), TensorInfo::element_size(), TensorInfo::extend_padding(), BorderSize::left, Dimensions< T >::num_dimensions(), TensorInfo::padding(), BorderSize::right, BorderSize::top, and TensorShape::total_size().
Referenced by Pyramid::init_auto_padding(), CLPyramid::init_auto_padding(), CLMultiImage::init_auto_padding(), MultiImage::init_auto_padding(), and TensorInfo::init_auto_padding().
|
overridevirtual |
Provide a clone of the current object of class T.
Implements ICloneable< ITensorInfo >.
Definition at line 316 of file TensorInfo.cpp.
Referenced by NESoftmaxLayerGeneric< IS_LOG >::configure(), CpuSoftmaxGeneric< IS_LOG >::configure(), CLFFTConvolutionLayer::configure(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::TEST_CASE(), CPPSplit< CLSlice, ICLTensor >::validate(), NEGEMM::validate(), NEWinogradConvolutionLayer::validate(), CLWinogradConvolutionLayer::validate(), CLGEMMDeconvolutionLayer::validate(), NELSTMLayerQuantized::validate(), and CLLSTMLayerQuantized::validate().
|
inlineoverridevirtual |
Get the data layout of the tensor.
Implements ITensorInfo.
Definition at line 315 of file TensorInfo.h.
Referenced by GCAccessor::data_layout(), CLAccessor::data_layout(), TensorInfo::set_data_layout(), and TensorInfo::TensorInfo().
|
inlineoverridevirtual |
Data type used for each element of the tensor.
Implements ITensorInfo.
Definition at line 270 of file TensorInfo.h.
Referenced by CLLSTMLayer::configure(), GCAccessor::data_type(), CLAccessor::data_type(), TensorInfo::init(), TensorInfo::init_auto_padding(), arm_compute::operator<<(), TensorInfo::set_data_type(), arm_compute::test::validation::TEST_CASE(), NEQLSTMLayer::validate(), and CLQLSTMLayer::validate().
|
inlineoverridevirtual |
Return the size of the requested dimension.
[in] | index | Index of the dimension |
Implements ITensorInfo.
Definition at line 233 of file TensorInfo.h.
Referenced by CLMeanStdDev::configure(), and CLLaplacianReconstruct::configure().
|
inlineoverridevirtual |
Return the size of the requested data layout dimension.
[in] | dimension | DataLayoutDimension of the dimension |
Implements ITensorInfo.
Definition at line 237 of file TensorInfo.h.
References arm_compute::get_data_layout_dimension_index().
|
inlineoverridevirtual |
Element size in bytes calculated as data_size() * num_channels()
Implements ITensorInfo.
Definition at line 250 of file TensorInfo.h.
References arm_compute::data_size_from_type().
Referenced by TensorInfo::auto_padding(), GCAccessor::element_size(), CLAccessor::element_size(), and CLQLSTMLayer::prepare().
|
overridevirtual |
Update the offset to the first element, the strides and the total size.
[in] | padding | Padding around the XY plane in number of elements. |
Implements ITensorInfo.
Definition at line 281 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, BorderSize::bottom, BorderSize::left, BorderSize::right, and BorderSize::top.
Referenced by TensorInfo::auto_padding(), and arm_compute::test::validation::DATA_TEST_CASE().
|
inlineoverridevirtual |
Colour format of the image.
Implements ITensorInfo.
Definition at line 274 of file TensorInfo.h.
Referenced by GCAccessor::format(), CLAccessor::format(), TensorAllocator::init(), TensorInfo::init(), TensorInfo::init_auto_padding(), and TensorInfo::set_format().
|
inlineoverridevirtual |
Checks if the tensor has been allocated with padding or not.
Implements ITensorInfo.
Definition at line 286 of file TensorInfo.h.
References BorderSize::empty().
void init | ( | Format | format | ) |
Initialize the tensor info with just a format.
Can be used for automatic derivation of the shape by the function.
[in] | format | Single plane format of the tensor. |
Definition at line 109 of file TensorInfo.cpp.
Referenced by NEWinogradConvolutionLayer::configure(), NECannyEdge::configure(), CLCannyEdge::configure(), NEHarrisCorners::configure(), arm_compute::test::validation::DATA_TEST_CASE(), TensorAllocator::init(), TensorInfo::init(), and TensorInfo::TensorInfo().
void init | ( | const TensorShape & | tensor_shape, |
Format | format | ||
) |
Initialize the metadata structure with the given parameters.
[in] | tensor_shape | Size for each dimension of the tensor in number of elements. |
[in] | format | Single plane format of the tensor. |
Definition at line 114 of file TensorInfo.cpp.
References arm_compute::data_type_from_format(), TensorInfo::format(), TensorInfo::init(), TensorInfo::num_channels(), arm_compute::num_channels_from_format(), and type.
void init | ( | const TensorShape & | tensor_shape, |
Format | format, | ||
const Strides & | strides_in_bytes, | ||
size_t | offset_first_element_in_bytes, | ||
size_t | total_size_in_bytes | ||
) |
Initialize the metadata structure with the given parameters.
[in] | tensor_shape | Size for each dimension of the tensor in number of elements. |
[in] | format | Single plane format of the tensor. |
[in] | strides_in_bytes | Stride in bytes for accessing each dimension of the tensor. |
[in] | offset_first_element_in_bytes | Offset in bytes from the beginning of memory allocation to access the first element. |
[in] | total_size_in_bytes | Size in bytes of the memory allocation (including the offset to the first element). |
Definition at line 124 of file TensorInfo.cpp.
References arm_compute::data_type_from_format(), TensorInfo::format(), TensorInfo::init(), TensorInfo::num_channels(), arm_compute::num_channels_from_format(), and type.
void init | ( | size_t | num_channels, |
DataType | data_type | ||
) |
Initialize the tensor info with just a format.
Can be used for automatic derivation of the shape by the function.
[in] | num_channels | Desired number of channels for each tensor element. |
[in] | data_type | Data type to use for each tensor element. |
Definition at line 136 of file TensorInfo.cpp.
References TensorInfo::init().
void init | ( | const TensorShape & | tensor_shape, |
size_t | num_channels, | ||
DataType | data_type | ||
) |
Initialize the metadata structure with the given parameters.
[in] | tensor_shape | Size for each dimension of the tensor in number of elements. |
[in] | num_channels | Desired number of channels for each tensor element. |
[in] | data_type | Data type to use for each tensor element. |
Definition at line 141 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, TensorInfo::data_type(), TensorInfo::num_channels(), TensorInfo::set_tensor_shape(), and arm_compute::UNKNOWN.
void init | ( | const TensorShape & | tensor_shape, |
size_t | num_channels, | ||
DataType | data_type, | ||
const Strides & | strides_in_bytes, | ||
size_t | offset_first_element_in_bytes, | ||
size_t | total_size_in_bytes | ||
) |
Initialize the metadata structure with the given parameters.
[in] | tensor_shape | Size for each dimension of the tensor in number of elements. |
[in] | num_channels | Desired number of channels for each tensor element. |
[in] | data_type | Data type to use for each tensor element. |
[in] | strides_in_bytes | Stride in bytes for accessing each dimension of the tensor. |
[in] | offset_first_element_in_bytes | Offset in bytes from the beginning of memory allocation to access the first element. |
[in] | total_size_in_bytes | Size in bytes of the memory allocation (including the offset to the first element). |
Definition at line 152 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, TensorInfo::data_type(), TensorInfo::num_channels(), TensorInfo::offset_first_element_in_bytes(), TensorInfo::strides_in_bytes(), TensorInfo::tensor_shape(), and arm_compute::UNKNOWN.
void init | ( | const HOGInfo & | hog_info, |
unsigned int | width, | ||
unsigned int | height | ||
) |
Initialize the metadata structure for the given HOG's metadata.
[in] | hog_info | HOG's metadata used to allocate normalized HOG space |
[in] | width | Width of the 2D tensor where the HOG descriptor will be computed on |
[in] | height | Height of the 2D tensor where the HOG descriptor will be computed on |
Definition at line 169 of file TensorInfo.cpp.
References Size2D::area(), arm_compute::F32, Size2D::height, TensorInfo::init(), HOGInfo::num_bins(), HOGInfo::num_block_positions_per_image(), HOGInfo::num_cells_per_block(), TensorInfo::num_channels(), and Size2D::width.
size_t init_auto_padding | ( | const TensorShape & | tensor_shape, |
Format | format | ||
) |
Initialize the metadata structure for the given tensor shape and single-plane format, (Padding is automatically calculated)
[in] | tensor_shape | It specifies the size for each dimension of the tensor in number of elements |
[in] | format | Single plane format of the image. |
Definition at line 183 of file TensorInfo.cpp.
References arm_compute::data_type_from_format(), TensorInfo::format(), TensorInfo::num_channels(), arm_compute::num_channels_from_format(), TensorInfo::total_size(), and type.
Referenced by TensorInfo::init_auto_padding().
size_t init_auto_padding | ( | const TensorShape & | tensor_shape, |
size_t | num_channels, | ||
DataType | data_type | ||
) |
Initialize the metadata structure for the given tensor shape, number of channels and data type.
(Padding is automatically calculated)
[in] | tensor_shape | It specifies the size for each dimension of the tensor in number of elements |
[in] | num_channels | It indicates the number of channels for each tensor element |
[in] | data_type | Data type to use for each tensor element |
Definition at line 194 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, TensorInfo::auto_padding(), TensorInfo::data_type(), TensorInfo::num_channels(), TensorInfo::tensor_shape(), and arm_compute::UNKNOWN.
size_t init_auto_padding | ( | const HOGInfo & | hog_info, |
unsigned int | width, | ||
unsigned int | height | ||
) |
Initialize the metadata structure for the given HOG's metadata.
[in] | hog_info | HOG's metadata used to allocate normalized HOG space |
[in] | width | Width of the 2D tensor where the HOG descriptor will be computed on |
[in] | height | Height of the 2D tensor where the HOG descriptor will be computed on |
Definition at line 210 of file TensorInfo.cpp.
References Size2D::area(), arm_compute::F32, Size2D::height, TensorInfo::init_auto_padding(), HOGInfo::num_bins(), HOGInfo::num_block_positions_per_image(), HOGInfo::num_cells_per_block(), TensorInfo::num_channels(), and Size2D::width.
|
inlineoverridevirtual |
Flag indicating whether the shape of the tensor is dynamic, meaning that it can change on kernel/function execution.
Implements ITensorInfo.
Definition at line 294 of file TensorInfo.h.
References enable_tracing::find().
|
inlineoverridevirtual |
Flag indicating whether the size of the tensor can be changed.
Implements ITensorInfo.
Definition at line 290 of file TensorInfo.h.
Referenced by TensorInfo::set_is_resizable(), and arm_compute::test::validation::TEST_CASE().
|
inlineoverridevirtual |
The number of channels for each tensor element.
Implements ITensorInfo.
Definition at line 258 of file TensorInfo.h.
Referenced by arm_compute::test::validation::reference::hog_multi_detection(), TensorInfo::init(), TensorInfo::init_auto_padding(), GCAccessor::num_channels(), CLAccessor::num_channels(), arm_compute::operator<<(), TensorInfo::set_num_channels(), and arm_compute::test::validation::TEST_CASE().
|
inlineoverridevirtual |
The number of dimensions of the tensor (rank)
Implements ITensorInfo.
Definition at line 254 of file TensorInfo.h.
References Dimensions< T >::num_dimensions().
Referenced by CLLaplacianReconstruct::configure(), CLGaussianPyramidHalf::configure(), and CLGaussianPyramidOrb::configure().
|
overridevirtual |
The offset in bytes from the beginning of the memory allocation to access the element at position (x, y, z ...)
[in] | pos | Vector with the coordinates of the element to access. The size of this vector must be equal to the number of dimensions of the tensor |
Implements ITensorInfo.
Definition at line 402 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE, Dimensions< T >::num_dimensions(), and offset().
Referenced by CLMeanStdDev::configure(), TensorAllocator::init(), and TensorInfo::offset_first_element_in_bytes().
|
inlineoverridevirtual |
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
Implements ITensorInfo.
Definition at line 245 of file TensorInfo.h.
References TensorInfo::offset_element_in_bytes().
Referenced by TensorAllocator::init(), and TensorInfo::init().
|
default |
Allow instances of this class to be copied.
|
default |
Allow instances of this class to be moved.
|
inlineoverridevirtual |
Padding of tensor.
Implements ITensorInfo.
Definition at line 282 of file TensorInfo.h.
Referenced by TensorInfo::auto_padding(), arm_compute::test::validation::DATA_TEST_CASE(), GCAccessor::padding(), CLAccessor::padding(), and arm_compute::test::validation::TEST_CASE().
|
inlineoverridevirtual |
Get the quantization settings (scale and offset) of the tensor.
Implements ITensorInfo.
Definition at line 311 of file TensorInfo.h.
Referenced by CLQLSTMLayer::configure(), GCAccessor::quantization_info(), CLAccessor::quantization_info(), TensorInfo::set_quantization_info(), and arm_compute::test::validation::TEST_CASE().
|
overridevirtual |
Resets the padding settings of the tensor.
Implements ITensorInfo.
Definition at line 392 of file TensorInfo.cpp.
References arm_compute::UNKNOWN.
|
overridevirtual |
Set the data layout of the tensor.
[in] | data_layout | DataLayout containing the layout data information. |
Implements ITensorInfo.
Definition at line 386 of file TensorInfo.cpp.
References TensorInfo::data_layout().
Referenced by NEDeconvolutionLayer::configure(), CLFFTConvolutionLayer::configure(), CLDirectDeconvolutionLayer::configure(), NEDeviceBackend::create_tensor(), GCDeviceBackend::create_tensor(), CLDeviceBackend::create_tensor(), arm_compute::test::create_tensor(), and NumPyAccessor::NumPyAccessor().
|
overridevirtual |
Set the data type to the specified value.
[in] | data_type | The new data type. |
Implements ITensorInfo.
Definition at line 321 of file TensorInfo.cpp.
References TensorInfo::data_type(), TensorInfo::set_tensor_shape(), TensorInfo::tensor_shape(), and arm_compute::UNKNOWN.
Referenced by NEReduceMean::configure(), CLReduceMean::configure(), CpuLogits1DSoftmaxKernel< IS_LOG >::configure(), arm_compute::test::validation::TEST_CASE(), NEL2NormalizeLayer::validate(), NEReductionOperation::validate(), CLArgMinMaxLayer::validate(), CLL2NormalizeLayer::validate(), CLReductionOperation::validate(), NEGenerateProposalsLayer::validate(), CLGEMMDeconvolutionLayer::validate(), and CLGenerateProposalsLayer::validate().
|
overridevirtual |
Set the format of an already initialized tensor.
[in] | format | Single-plane format of the tensor. |
Implements ITensorInfo.
Definition at line 335 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, arm_compute::data_type_from_format(), TensorInfo::format(), arm_compute::num_channels_from_format(), and arm_compute::UNKNOWN.
|
inlineoverridevirtual |
Set the flag whether the tensor size can be changed.
[in] | is_resizable | Flag that marks the tensor if it can be changed or not. |
Implements ITensorInfo.
Definition at line 298 of file TensorInfo.h.
References TensorInfo::is_resizable().
Referenced by TensorAllocator::allocate(), GCTensorAllocator::allocate(), CLTensorAllocator::allocate(), TensorAllocator::free(), GCTensorAllocator::free(), CLTensorAllocator::free(), TensorAllocator::import_memory(), CLTensorAllocator::import_memory(), and TensorAllocator::~TensorAllocator().
|
overridevirtual |
Set the number of channels to the specified value.
[in] | num_channels | New number of channels. |
Implements ITensorInfo.
Definition at line 328 of file TensorInfo.cpp.
References TensorInfo::num_channels(), and arm_compute::UNKNOWN.
|
overridevirtual |
Set the quantization settings (scale and offset) of the tensor.
[in] | quantization_info | QuantizationInfo containing the scale and offset |
Implements ITensorInfo.
Definition at line 380 of file TensorInfo.cpp.
References TensorInfo::quantization_info().
Referenced by CpuLogits1DSoftmaxKernel< IS_LOG >::configure(), CLGEMMDeconvolutionLayer::configure(), CLLSTMLayerQuantized::configure(), NEGEMMConvolutionLayer::configure(), CLGEMMConvolutionLayer::configure(), arm_compute::test::create_tensor(), NELSTMLayerQuantized::validate(), CLLSTMLayerQuantized::validate(), and NEGEMMConvolutionLayer::validate().
|
overridevirtual |
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
[in] | state | Tensor dimensions state |
Implements ITensorInfo.
Definition at line 374 of file TensorInfo.cpp.
|
overridevirtual |
Set the shape of an already initialized tensor.
[in] | shape | New tensor shape. |
Implements ITensorInfo.
Definition at line 352 of file TensorInfo.cpp.
References arm_compute::compute_strides(), Dimensions< T >::num_dimensions(), and arm_compute::test::validation::shape.
Referenced by NEQLSTMLayer::configure(), CLQLSTMLayer::configure(), TensorInfo::init(), TensorInfo::set_data_type(), arm_compute::test::validation::TEST_CASE(), NEQLSTMLayer::validate(), and CLQLSTMLayer::validate().
|
inlineoverridevirtual |
Set the valid region of the tensor.
[in] | valid_region | Valid region to set. |
Implements ITensorInfo.
Definition at line 307 of file TensorInfo.h.
References TensorInfo::valid_region().
|
inlineoverridevirtual |
The strides in bytes for accessing each dimension of the tensor.
Implements ITensorInfo.
Definition at line 241 of file TensorInfo.h.
Referenced by TensorAllocator::init(), and TensorInfo::init().
|
inlineoverridevirtual |
State of each dimension of the tensor shape.
Implements ITensorInfo.
Definition at line 266 of file TensorInfo.h.
|
inlineoverridevirtual |
Size for each dimension of the tensor.
Implements ITensorInfo.
Definition at line 262 of file TensorInfo.h.
Referenced by CLFFTConvolutionLayer::configure(), CLGenerateProposalsLayer::configure(), GCConvolutionLayer::configure(), NEQLSTMLayer::configure(), CLLSTMLayerQuantized::configure(), CLLSTMLayer::configure(), CLQLSTMLayer::configure(), CLGEMMConvolutionLayer::configure(), arm_compute::test::validation::reference::hog_multi_detection(), TensorAllocator::init(), TensorInfo::init(), TensorInfo::init_auto_padding(), GCAccessor::num_elements(), CLAccessor::num_elements(), arm_compute::operator<<(), TensorInfo::set_data_type(), GCAccessor::shape(), CLAccessor::shape(), arm_compute::test::validation::TEST_CASE(), CPPSplit< CLSlice, ICLTensor >::validate(), NEWinogradConvolutionLayer::validate(), CLWinogradConvolutionLayer::validate(), NELSTMLayerQuantized::validate(), and CLLSTMLayerQuantized::validate().
|
inlineoverridevirtual |
Returns the total size of the tensor in bytes.
Implements ITensorInfo.
Definition at line 278 of file TensorInfo.h.
Referenced by CLTensorAllocator::allocate(), TensorAllocator::init(), TensorInfo::init_auto_padding(), CLQLSTMLayer::prepare(), CLFastCorners::run(), GCAccessor::size(), CLAccessor::size(), and arm_compute::test::validation::TEST_CASE().
|
inlineoverridevirtual |
Valid region of the tensor.
All elements in the valid region have defined values, i.e. are not undefined.
Implements ITensorInfo.
Definition at line 303 of file TensorInfo.h.
Referenced by TensorInfo::set_valid_region().