ONE - On-device Neural Engine
|
#include <ITensor.h>
Public Member Functions | |
virtual | ~ITensor () |
virtual uint8_t * | buffer () const =0 |
virtual size_t | total_size () const =0 |
virtual size_t | calcOffset (const ir::Coordinates &coords) const =0 |
virtual ir::DataType | data_type () const =0 |
virtual float | data_scale () const =0 |
virtual int32_t | data_zero_point () const =0 |
virtual const std::vector< float > & | data_scales () const =0 |
virtual const std::vector< int32_t > & | data_zero_points () const =0 |
virtual bool | has_padding () const =0 |
virtual void | access (const std::function< void(ITensor &tensor)> &fn)=0 |
virtual bool | applyShape (const ir::Shape &) |
Set the shape to shape and possibly re-allocate the buffer. | |
virtual bool | is_constant () const |
Return true if the tensor is constant. | |
virtual bool | is_dynamic () const =0 |
Return true if the tensor needs dynamic allocation, meaning that during compile-time the outpus shape cannot be known and the output shape is calculated during kernel execution-time. | |
virtual void | set_dynamic () |
set this tensor dynamic | |
virtual void | deallocBuffer () |
Dealloc the buffer (only for dynamic tensors) | |
virtual void | setShape (const ir::Shape &) |
Set the shape of tenser to new_shape. | |
virtual ir::Shape | getShape () const =0 |
Get ir::Shape of tensor. | |
virtual bool | is_subtensor () const |
virtual bool | needMemoryMap () const |
virtual void | enqueueWriteBuffer (const void *, bool) |
virtual void | enqueueReadBuffer (void *, bool) |
|
virtual |
Definition at line 26 of file ITensor.cc.
|
pure virtual |
|
inlinevirtual |
Set the shape to shape
and possibly re-allocate the buffer.
If a tensor is dynamic tensor and previously allocated memory exists, it will be deallocated. If a tensor is static tensor (with previously allocated memory by StaticTensorManager), buffer()
will be overwriten
shape | tensor's new shape. While allocating memory for this new_shape, tensor's shape is set to new_shape |
Reimplemented in onert::backend::train::Tensor, onert::backend::builtin::UserTensor, onert::backend::basic::Tensor, onert::exec::EdgeTensor, and onert::backend::builtin::IOTensor.
Definition at line 65 of file ITensor.h.
Referenced by onert::backend::builtin::IOTensor::applyShape(), and onert::backend::builtin::kernel::PermuteLayer::run().
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, onert::backend::basic::Tensor, onert::backend::basic::ExternalTensor, onert::backend::basic::train::TrainableTensor, onert::backend::builtin::IOTensor, onert::backend::builtin::UserTensor, and onert::exec::EdgeTensor.
Referenced by onert::backend::train::ops::biasGrad(), onert::backend::builtin::IOTensor::buffer(), onert::backend::ruy::ops::ConvolutionLayer::convFloat32(), onert::backend::xnnpack::ops::ConvolutionLayer::create(), onert::backend::xnnpack::ops::DepthwiseConvolutionLayer::create(), onert::backend::xnnpack::ops::FullyConnectedLayer::create(), onert::backend::train::ops::PadLayer::depad(), onert::backend::ruy::ops::FullyConnectedLayer::fullyConnectedFloat32(), onert::backend::builtin::kernel::PermuteLayer::optimize(), onert::backend::cpu::ops::PadLayer::padImpl(), onert::backend::cpu::ops::FullyConnectedLayer::prepare(), onert::backend::ruy::ops::FullyConnectedLayer::prepare(), onert::backend::cpu::ops::ReshapeLayer::reshapeGeneric(), onert::backend::cpu::ops::BroadcastToLayer::run(), onert::backend::cpu::ops::DetectionPostProcessLayer::run(), onert::backend::cpu::ops::ExpandDimsLayer::run(), onert::backend::cpu::ops::PadLayer::run(), onert::backend::builtin::kernel::PermuteLayer::run(), onert::backend::xnnpack::ops::ConvolutionLayer::setup(), onert::backend::xnnpack::ops::DepthwiseConvolutionLayer::setup(), and onert::backend::xnnpack::ops::FullyConnectedLayer::setup().
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
Referenced by onert::exec::UpdateOffsets().
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
Referenced by onert::exec::IPermuteFunction::permute().
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
|
inlinevirtual |
Dealloc the buffer (only for dynamic tensors)
Reimplemented in onert::backend::basic::Tensor.
Definition at line 89 of file ITensor.h.
|
inlinevirtual |
Reimplemented in onert::backend::acl_cl::operand::ICLTensor.
Definition at line 115 of file ITensor.h.
|
inlinevirtual |
Reimplemented in onert::backend::acl_cl::operand::ICLTensor.
Definition at line 111 of file ITensor.h.
|
pure virtual |
Get ir::Shape of tensor.
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
Referenced by onert::backend::builtin::kernel::PermuteLayer::run(), and onert::exec::DynamicShapeInferer::visit().
|
pure virtual |
|
inlinevirtual |
Return true if the tensor is constant.
Reimplemented in onert::backend::IPortableTensor.
Definition at line 70 of file ITensor.h.
|
pure virtual |
Return true if the tensor needs dynamic allocation, meaning that during compile-time the outpus shape cannot be known and the output shape is calculated during kernel execution-time.
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
Referenced by onert::backend::builtin::kernel::PermuteLayer::run().
|
inlinevirtual |
Reimplemented in onert::backend::acl_cl::operand::CLSubTensor, and onert::backend::acl_neon::operand::NESubTensor.
Definition at line 109 of file ITensor.h.
|
inlinevirtual |
Reimplemented in onert::backend::acl_cl::operand::ICLTensor.
Definition at line 110 of file ITensor.h.
|
inlinevirtual |
set this tensor dynamic
Reimplemented in onert::backend::basic::Tensor, onert::backend::basic::ExternalTensor, onert::backend::builtin::IOTensor, onert::backend::builtin::UserTensor, and onert::exec::EdgeTensor.
Definition at line 83 of file ITensor.h.
Referenced by onert::backend::builtin::IOTensor::set_dynamic().
|
inlinevirtual |
Set the shape of tenser to new_shape.
Reimplemented in onert::backend::basic::ExternalTensor, onert::backend::basic::Tensor, onert::backend::builtin::UserTensor, onert::exec::EdgeTensor, and onert::backend::builtin::IOTensor.
Definition at line 98 of file ITensor.h.
Referenced by onert::backend::builtin::IOTensor::setShape().
|
pure virtual |
Implemented in onert::backend::acl_common::IACLTensor, and onert::backend::IPortableTensor.
Referenced by onert::exec::IPermuteFunction::permute().