21.05
|
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... | |
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... | |
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... | |
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 | |
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, 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 43 of file TensorInfo.h.
TensorInfo | ( | ) |
Default constructor.
Definition at line 36 of file TensorInfo.cpp.
References arm_compute::UNKNOWN.
|
default |
Default destructor.
TensorInfo | ( | const ITensorInfo & | info | ) |
Allow instances of this class to be copy constructed.
Definition at line 42 of file TensorInfo.cpp.
References ScaleKernelInfo::data_layout, and arm_compute::test::validation::info.
|
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 60 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 65 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 70 of file TensorInfo.cpp.
References TensorInfo::format(), TensorInfo::init(), and TensorInfo::tensor_shape().
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 76 of file TensorInfo.cpp.
References TensorInfo::data_type(), TensorInfo::init(), and TensorInfo::num_channels().
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 82 of file TensorInfo.cpp.
References TensorInfo::data_type(), TensorInfo::init(), TensorInfo::num_channels(), and TensorInfo::tensor_shape().
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 95 of file TensorInfo.cpp.
References TensorInfo::data_layout(), TensorInfo::data_type(), TensorInfo::init(), TensorInfo::num_channels(), and TensorInfo::tensor_shape().
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 88 of file TensorInfo.cpp.
References TensorInfo::data_type(), TensorInfo::init(), TensorInfo::num_channels(), TensorInfo::quantization_info(), and TensorInfo::tensor_shape().
|
overridevirtual |
Update the offset to the first element and the strides to automatically computed values.
Implements ITensorInfo.
Definition at line 189 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, TensorInfo::extend_padding(), and Dimensions< T >::num_dimensions().
Referenced by TensorInfo::init_auto_padding().
|
overridevirtual |
Provide a clone of the current object of class T.
Implements ICloneable< ITensorInfo >.
Definition at line 281 of file TensorInfo.cpp.
Referenced by CLFFTConvolutionLayer::configure(), CPPSplit< CLSlice, ICLTensor >::validate(), NEGEMM::validate(), NEWinogradConvolutionLayer::validate(), CLWinogradConvolutionLayer::validate(), NELSTMLayerQuantized::validate(), CLGEMMDeconvolutionLayer::validate(), and CLLSTMLayerQuantized::validate().
|
inlineoverridevirtual |
Get the data layout of the tensor.
Implements ITensorInfo.
Definition at line 287 of file TensorInfo.h.
Referenced by arm_compute::calculate_valid_region_scale(), 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 242 of file TensorInfo.h.
Referenced by arm_compute::test::validation::compute_float_reference(), CLLSTMLayer::configure(), CLAccessor::data_type(), TensorInfo::init(), TensorInfo::init_auto_padding(), TensorInfo::set_data_type(), TensorInfo::TensorInfo(), NEQLSTMLayer::validate(), and CLQLSTMLayer::validate().
|
inlineoverridevirtual |
Return the size of the requested dimension.
[in] | index | Index of the dimension |
Implements ITensorInfo.
Definition at line 205 of file TensorInfo.h.
Referenced by ITensor::copy_from(), and TensorInfo::dimension().
|
inlineoverridevirtual |
Return the size of the requested data layout dimension.
[in] | dimension | DataLayoutDimension of the dimension |
Implements ITensorInfo.
Definition at line 209 of file TensorInfo.h.
References TensorInfo::dimension(), and arm_compute::get_data_layout_dimension_index().
|
inlineoverridevirtual |
Element size in bytes calculated as data_size() * num_channels()
Implements ITensorInfo.
Definition at line 222 of file TensorInfo.h.
References arm_compute::data_size_from_type().
Referenced by ITensor::copy_from(), 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 246 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, BorderSize::bottom, BorderSize::left, TensorInfo::padding(), BorderSize::right, and BorderSize::top.
Referenced by TensorInfo::auto_padding().
|
inlineoverridevirtual |
Colour format of the image.
Implements ITensorInfo.
Definition at line 246 of file TensorInfo.h.
Referenced by CLAccessor::format(), TensorAllocator::init(), TensorInfo::init(), TensorInfo::init_auto_padding(), TensorInfo::set_format(), and TensorInfo::TensorInfo().
|
inlineoverridevirtual |
Checks if the tensor has been allocated with padding or not.
Implements ITensorInfo.
Definition at line 258 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 102 of file TensorInfo.cpp.
References TensorInfo::format().
Referenced by NEWinogradConvolutionLayer::configure(), arm_compute::detail::convert_to_legacy_tensor_info(), 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 107 of file TensorInfo.cpp.
References arm_compute::data_type_from_format(), TensorInfo::format(), TensorInfo::init(), TensorInfo::num_channels(), arm_compute::num_channels_from_format(), TensorInfo::tensor_shape(), 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 117 of file TensorInfo.cpp.
References arm_compute::data_type_from_format(), TensorInfo::format(), TensorInfo::init(), TensorInfo::num_channels(), arm_compute::num_channels_from_format(), TensorInfo::offset_first_element_in_bytes(), TensorInfo::strides_in_bytes(), TensorInfo::tensor_shape(), 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 129 of file TensorInfo.cpp.
References TensorInfo::data_type(), TensorInfo::init(), and TensorInfo::num_channels().
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 134 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON, TensorInfo::data_type(), TensorInfo::num_channels(), TensorInfo::set_tensor_shape(), TensorInfo::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 145 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.
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 162 of file TensorInfo.cpp.
References arm_compute::data_type_from_format(), TensorInfo::format(), TensorInfo::num_channels(), arm_compute::num_channels_from_format(), TensorInfo::tensor_shape(), TensorInfo::total_size(), and type.
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 173 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.
|
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 266 of file TensorInfo.h.
References ITensorInfo::get_dynamic_state_value().
|
inlineoverridevirtual |
Flag indicating whether the size of the tensor can be changed.
Implements ITensorInfo.
Definition at line 262 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 230 of file TensorInfo.h.
Referenced by ITensor::copy_from(), TensorInfo::init(), TensorInfo::init_auto_padding(), CLAccessor::num_channels(), TensorInfo::set_num_channels(), and TensorInfo::TensorInfo().
|
inlineoverridevirtual |
The number of dimensions of the tensor (rank)
Implements ITensorInfo.
Definition at line 226 of file TensorInfo.h.
References Dimensions< T >::num_dimensions().
Referenced by ITensor::copy_from().
|
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 367 of file TensorInfo.cpp.
References ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE, Dimensions< T >::num_dimensions(), and offset().
Referenced by TensorAllocator::init().
|
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 217 of file TensorInfo.h.
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 254 of file TensorInfo.h.
Referenced by TensorInfo::extend_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 283 of file TensorInfo.h.
Referenced by CLQLSTMLayer::configure(), CLAccessor::quantization_info(), TensorInfo::set_quantization_info(), TensorInfo::TensorInfo(), and arm_compute::test::validation::TEST_CASE().
|
overridevirtual |
Resets the padding settings of the tensor.
Implements ITensorInfo.
Definition at line 357 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 351 of file TensorInfo.cpp.
References TensorInfo::data_layout().
Referenced by NECropResize::configure(), CLCropResize::configure(), NEDeconvolutionLayer::configure(), CLFFTConvolutionLayer::configure(), and CLDirectDeconvolutionLayer::configure().
|
overridevirtual |
Set the data type to the specified value.
[in] | data_type | The new data type. |
Implements ITensorInfo.
Definition at line 286 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(), NEL2NormalizeLayer::validate(), NEReductionOperation::validate(), CLL2NormalizeLayer::validate(), CLArgMinMaxLayer::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 300 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 270 of file TensorInfo.h.
References TensorInfo::is_resizable().
Referenced by TensorAllocator::allocate(), CLTensorAllocator::allocate(), TensorAllocator::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 293 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 345 of file TensorInfo.cpp.
References TensorInfo::quantization_info().
Referenced by CpuLogits1DSoftmaxKernel< IS_LOG >::configure(), CLGEMMDeconvolutionLayer::configure(), CLLSTMLayerQuantized::configure(), NEGEMMConvolutionLayer::configure(), CLGEMMConvolutionLayer::configure(), 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 339 of file TensorInfo.cpp.
|
overridevirtual |
Set the shape of an already initialized tensor.
[in] | shape | New tensor shape. |
Implements ITensorInfo.
Definition at line 317 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(), 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 279 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 213 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 238 of file TensorInfo.h.
|
inlineoverridevirtual |
Size for each dimension of the tensor.
Implements ITensorInfo.
Definition at line 234 of file TensorInfo.h.
Referenced by arm_compute::calculate_valid_region_scale(), arm_compute::test::validation::compute_float_reference(), CLFFTConvolutionLayer::configure(), CLGenerateProposalsLayer::configure(), NEQLSTMLayer::configure(), CLLSTMLayerQuantized::configure(), CLLSTMLayer::configure(), CLQLSTMLayer::configure(), CLGEMMConvolutionLayer::configure(), ITensor::copy_from(), TensorAllocator::init(), TensorInfo::init(), TensorInfo::init_auto_padding(), CLAccessor::num_elements(), CpuElementwiseUnary::run(), TensorInfo::set_data_type(), CLAccessor::shape(), TensorInfo::TensorInfo(), 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 250 of file TensorInfo.h.
Referenced by CLTensorAllocator::allocate(), TensorAllocator::init(), TensorInfo::init_auto_padding(), CLQLSTMLayer::prepare(), CLAccessor::size(), arm_compute::test::validation::TEST_CASE(), and ClSoftmax::workspace().
|
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 275 of file TensorInfo.h.
Referenced by arm_compute::calculate_valid_region_scale(), ITensor::copy_from(), and TensorInfo::set_valid_region().