ONE - On-device Neural Engine
|
Class to save tensor's shape and type. More...
#include <OperandInfo.h>
Public Member Functions | |
OperandInfo ()=delete | |
Construct a new OperandInfo object (deleted) | |
OperandInfo (const Shape &shape, const TypeInfo &typeInfo, MemAllocType alloc_type, bool is_const=false, bool is_variable=false, OriginIndex origin=OriginIndex()) | |
Construct a new OperandInfo object. | |
OperandInfo (const OperandInfo &origin)=default | |
Construct a new OperandInfo object. | |
const Shape & | shape () const |
Return tensor shape. | |
Shape & | shape () |
Return mutable tensor shape. | |
void | shape (const ir::Shape &new_shape) |
set shape | |
const TypeInfo & | typeInfo () const |
Return tensor data type info. | |
void | typeInfo (const ir::TypeInfo &typeInfo) |
Set type information. | |
void | type (const DataType type) |
Set tensor data type. | |
size_t | total_size () const |
Return size of tensor (bytes) | |
MemAllocType | memAllocType () const |
void | setAsConstant () |
void | setAsNonConst () |
bool | isConstant () const |
void | setAsVariable () |
bool | isVariable () const |
bool | isDynamic () const |
void | setDynamic () |
OriginIndex | originIndex () const |
void | setOriginIndex (OriginIndex origin) |
Static Public Member Functions | |
static OperandInfo | createStaticInfo (const Shape &shape, const TypeInfo &typeInfo) |
Create a static OperandInfo object. | |
Class to save tensor's shape and type.
Definition at line 55 of file OperandInfo.h.
|
delete |
Construct a new OperandInfo object (deleted)
Referenced by createStaticInfo().
|
inline |
Construct a new OperandInfo object.
[in] | shape | Tensor shape |
[in] | typeInfo | Tensor data type |
[in] | alloc_type | When the thesor needs memory allocation |
Definition at line 69 of file OperandInfo.h.
|
default |
Construct a new OperandInfo object.
[in] | origin | info for copy |
|
inlinestatic |
Create a static OperandInfo object.
Definition at line 85 of file OperandInfo.h.
References OperandInfo(), shape(), onert::ir::STATIC, and typeInfo().
|
inline |
Definition at line 128 of file OperandInfo.h.
References isDynamic().
Referenced by onert::backend::basic::ExternalTensor::ExternalTensor(), onert::backend::IPortableTensor::is_constant(), and onert::ir::Operand::isConstant().
|
inline |
Definition at line 142 of file OperandInfo.h.
References onert::ir::DYNAMIC.
Referenced by onert::compiler::StaticShapeInferer::dump(), onert::backend::basic::ExternalTensor::ExternalTensor(), onert::backend::IPortableTensor::is_dynamic(), isConstant(), and setAsVariable().
|
inline |
Definition at line 141 of file OperandInfo.h.
|
inline |
Definition at line 125 of file OperandInfo.h.
|
inline |
Definition at line 144 of file OperandInfo.h.
Referenced by onert::ir::Operand::originIndex().
|
inline |
Definition at line 126 of file OperandInfo.h.
Referenced by onert::ir::Operand::data().
|
inline |
Definition at line 127 of file OperandInfo.h.
|
inline |
Definition at line 134 of file OperandInfo.h.
References isDynamic().
|
inline |
Definition at line 143 of file OperandInfo.h.
References onert::ir::DYNAMIC.
Referenced by onert::backend::builtin::IOTensor::applyShape(), onert::backend::basic::Tensor::set_dynamic(), onert::backend::builtin::IOTensor::set_dynamic(), onert::backend::builtin::UserTensor::set_dynamic(), onert::exec::EdgeTensor::set_dynamic(), and onert::backend::builtin::IOTensor::setTensor().
|
inline |
Definition at line 145 of file OperandInfo.h.
Referenced by onert::ir::Operand::setOriginIndex().
|
inline |
Return mutable tensor shape.
Definition at line 100 of file OperandInfo.h.
Referenced by RandomDataGenerator.RandomDataGenerator::_gen_float32(), RandomDataGenerator.RandomDataGenerator::_gen_int16(), and RandomDataGenerator.RandomDataGenerator::_gen_uint8().
|
inline |
Return tensor shape.
Definition at line 95 of file OperandInfo.h.
Referenced by RandomDataGenerator.RandomDataGenerator::_gen_float32(), RandomDataGenerator.RandomDataGenerator::_gen_int16(), RandomDataGenerator.RandomDataGenerator::_gen_uint8(), onert::backend::basic::Tensor::applyShape(), onert::backend::builtin::IOTensor::applyShape(), onert::backend::IPortableTensor::calcOffset(), onert::ir::train::TrainableGraph::changeBackwardShape(), onert::backend::train::ops::FullyConnectedLayer::configureBackward(), createStaticInfo(), onert::compiler::StaticShapeInferer::dump(), onert::backend::IPortableTensor::getShape(), onert::backend::basic::Tensor::setShape(), onert::backend::builtin::UserTensor::setShape(), onert::exec::EdgeTensor::setShape(), onert::backend::builtin::IOTensor::setShape(), onert::backend::builtin::IOTensor::setTensor(), and onert::ir::Operand::shape().
|
inline |
set shape
Definition at line 104 of file OperandInfo.h.
Referenced by RandomDataGenerator.RandomDataGenerator::_gen_float32(), RandomDataGenerator.RandomDataGenerator::_gen_int16(), and RandomDataGenerator.RandomDataGenerator::_gen_uint8().
size_t onert::ir::OperandInfo::total_size | ( | ) | const |
Return size of tensor (bytes)
Definition at line 24 of file OperandInfo.cc.
References onert::ir::sizeOfDataType(), and onert::ir::TypeInfo::type().
Referenced by onert::exec::EdgeTensor::allocate_buffer(), onert::backend::basic::Tensor::applyShape(), onert::exec::EdgeTensor::applyShape(), and onert::backend::IPortableTensor::total_size().
|
inline |
Set tensor data type.
Definition at line 118 of file OperandInfo.h.
References onert::ir::TypeInfo::type(), and type().
Referenced by onert::ir::Operand::type(), and type().
|
inline |
Return tensor data type info.
Definition at line 109 of file OperandInfo.h.
Referenced by createStaticInfo(), onert::backend::IPortableTensor::data_scale(), onert::backend::IPortableTensor::data_scales(), onert::backend::IPortableTensor::data_type(), onert::backend::IPortableTensor::data_zero_point(), onert::backend::IPortableTensor::data_zero_points(), onert::exec::SingleModelExecutors::execute(), onert::backend::IPortableTensor::sparsity(), and onert::ir::Operand::typeInfo().
|
inline |
Set type information.
[in] | typeInfo | Type information |
Definition at line 114 of file OperandInfo.h.
References typeInfo().
Referenced by typeInfo().