Compute Library
 21.02
TensorDescriptor Struct Referencefinal

Tensor metadata class. More...

#include <TensorDescriptor.h>

Collaboration diagram for TensorDescriptor:
[legend]

Public Member Functions

 TensorDescriptor ()=default
 Default Constructor. More...
 
 TensorDescriptor (TensorShape tensor_shape, DataType tensor_data_type, QuantizationInfo tensor_quant_info=QuantizationInfo(), DataLayout tensor_data_layout=DataLayout::NCHW, Target tensor_target=Target::UNSPECIFIED)
 Constructor. More...
 
TensorDescriptorset_shape (TensorShape &tensor_shape)
 Sets tensor descriptor shape. More...
 
TensorDescriptorset_data_type (DataType tensor_data_type)
 Sets tensor descriptor data type. More...
 
TensorDescriptorset_layout (DataLayout data_layout)
 Sets tensor descriptor data layout. More...
 
TensorDescriptorset_quantization_info (QuantizationInfo tensor_quant_info)
 Sets tensor descriptor quantization info. More...
 
std::unique_ptr< TensorDescriptorclone () const override
 Provide a clone of the current object of class T. More...
 
- Public Member Functions inherited from ICloneable< TensorDescriptor >
virtual ~ICloneable ()=default
 Default virtual desctructor. More...
 

Data Fields

TensorShape shape {}
 Tensor shape. More...
 
DataType data_type { DataType::UNKNOWN }
 Data type. More...
 
DataLayout layout { DataLayout::NCHW }
 Data layout. More...
 
QuantizationInfo quant_info {}
 Quantization info. More...
 
Target target { Target::UNSPECIFIED }
 Target. More...
 

Detailed Description

Tensor metadata class.

Definition at line 38 of file TensorDescriptor.h.

Constructor & Destructor Documentation

◆ TensorDescriptor() [1/2]

TensorDescriptor ( )
default

Default Constructor.

◆ TensorDescriptor() [2/2]

TensorDescriptor ( TensorShape  tensor_shape,
DataType  tensor_data_type,
QuantizationInfo  tensor_quant_info = QuantizationInfo(),
DataLayout  tensor_data_layout = DataLayout::NCHW,
Target  tensor_target = Target::UNSPECIFIED 
)
inline

Constructor.

Parameters
[in]tensor_shapeTensor shape
[in]tensor_data_typeTensor data type
[in]tensor_quant_infoTensor quantization info
[in]tensor_data_layoutTensor data layout
[in]tensor_targetTarget to allocate the tensor for

Definition at line 50 of file TensorDescriptor.h.

55  : shape(tensor_shape), data_type(tensor_data_type), layout(tensor_data_layout), quant_info(tensor_quant_info), target(tensor_target)
56  {
57  }
QuantizationInfo quant_info
Quantization info.

Member Function Documentation

◆ clone()

std::unique_ptr<TensorDescriptor> clone ( ) const
inlineoverridevirtual

Provide a clone of the current object of class T.

Returns
Clone object of class T

Implements ICloneable< TensorDescriptor >.

Definition at line 104 of file TensorDescriptor.h.

105  {
106  return std::make_unique<TensorDescriptor>(*this);
107  }

◆ set_data_type()

TensorDescriptor& set_data_type ( DataType  tensor_data_type)
inline

Sets tensor descriptor data type.

Parameters
[in]tensor_data_typeData type
Returns
This tensor descriptor

Definition at line 75 of file TensorDescriptor.h.

References TensorDescriptor::data_type.

76  {
77  data_type = tensor_data_type;
78  return *this;
79  }

◆ set_layout()

TensorDescriptor& set_layout ( DataLayout  data_layout)
inline

Sets tensor descriptor data layout.

Parameters
[in]data_layoutData layout
Returns
This tensor descriptor

Definition at line 86 of file TensorDescriptor.h.

References arm_compute::test::validation::data_layout, and TensorDescriptor::layout.

87  {
89  return *this;
90  }
const DataLayout data_layout
Definition: Im2Col.cpp:151

◆ set_quantization_info()

TensorDescriptor& set_quantization_info ( QuantizationInfo  tensor_quant_info)
inline

Sets tensor descriptor quantization info.

Parameters
[in]tensor_quant_infoQuantization information
Returns
This tensor descriptor

Definition at line 97 of file TensorDescriptor.h.

References TensorDescriptor::quant_info.

Referenced by DeconvolutionLayerNode::configure_output().

98  {
99  quant_info = tensor_quant_info;
100  return *this;
101  }
QuantizationInfo quant_info
Quantization info.

◆ set_shape()

TensorDescriptor& set_shape ( TensorShape tensor_shape)
inline

Sets tensor descriptor shape.

Parameters
[in]tensor_shapeTensor shape to set
Returns
This tensor descriptor

Definition at line 64 of file TensorDescriptor.h.

References TensorDescriptor::shape.

Referenced by ReductionLayerNode::configure_output(), and ArgMinMaxLayerNode::configure_output().

65  {
66  shape = tensor_shape;
67  return *this;
68  }

Field Documentation

◆ data_type

◆ layout

◆ quant_info

◆ shape

TensorShape shape {}

Tensor shape.

Definition at line 109 of file TensorDescriptor.h.

Referenced by GraphBuilder::add_batch_normalization_node(), GraphBuilder::add_convolution_node(), GraphBuilder::add_deconvolution_node(), GraphBuilder::add_depthwise_convolution_node(), GraphBuilder::add_fully_connected_layer(), GraphBuilder::add_normalize_planar_yuv_node(), GraphBuilder::add_scale_layer(), DepthToSpaceLayerNode::compute_output_descriptor(), SliceLayerNode::compute_output_descriptor(), ReorgLayerNode::compute_output_descriptor(), DetectionOutputLayerNode::compute_output_descriptor(), PoolingLayerNode::compute_output_descriptor(), PriorBoxLayerNode::compute_output_descriptor(), DeconvolutionLayerNode::compute_output_descriptor(), SplitLayerNode::compute_output_descriptor(), StridedSliceLayerNode::compute_output_descriptor(), FullyConnectedLayerNode::compute_output_descriptor(), FusedConvolutionBatchNormalizationNode::compute_output_descriptor(), DepthwiseConvolutionLayerNode::compute_output_descriptor(), FusedDepthwiseConvolutionBatchNormalizationNode::compute_output_descriptor(), ConvolutionLayerNode::compute_output_descriptor(), FullyConnectedLayerNode::compute_weights_descriptor(), FlattenLayerNode::configure_output(), ReshapeLayerNode::configure_output(), GenerateProposalsLayerNode::configure_output(), ResizeLayerNode::configure_output(), DummyNode::configure_output(), PermuteLayerNode::configure_output(), ReductionLayerNode::configure_output(), PadLayerNode::configure_output(), ROIAlignLayerNode::configure_output(), ArgMinMaxLayerNode::configure_output(), SplitLayerNode::configure_output(), EltwiseLayerNode::configure_output(), NEDeviceBackend::create_tensor(), GCDeviceBackend::create_tensor(), CLDeviceBackend::create_tensor(), arm_compute::graph::get_dimension_size(), SplitLayerSubTensorMutator::mutate(), DotGraphPrinter::print(), TensorDescriptor::set_shape(), and SplitLayerNode::validate().

◆ target


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