ONE - On-device Neural Engine
|
A bridge between ann::Module and coco::Block. More...
#include <Binder.h>
Public Member Functions | |
ANNBinder (coco::Block *block, std::unique_ptr< ann::Module > &&module) | |
const coco::Block * | block (void) const |
coco::Block * | block (void) |
const ann::Module * | module (void) const |
std::set< coco::Bag * > | bags (void) const |
Return the set of bags that the current ANN subnet accesses. | |
template<typename T > | |
ann::OperandID | addOperand (void) |
template<typename T > | |
ann::OperandID | addOperand (const nncc::core::ADT::tensor::Shape &shape) |
template<typename T > | |
ann::OperandID | addOperand (const coco::FeatureObject *obj) |
template<typename T > | |
ann::OperandID | addOperand (const coco::KernelObject *obj) |
template<typename T > | |
void | setOperand (const ann::OperandID &id, const T &value) |
Set scalar weight. | |
template<typename It > | |
void | setOperand (const ann::OperandID &id, It beg, It end) |
Set non-scalar weight. | |
void | addOperation (ann::Operation::Code code, std::initializer_list< ann::OperandID > inputs, std::initializer_list< ann::OperandID > outputs) |
template<typename It > | |
void | identifyInputs (It beg, It end) |
Identify a sequence of coco::Bag * as subnet's inputs. | |
template<typename T > | |
void | identifyInputs (T &&values) |
template<typename It > | |
void | identifyOutputs (It beg, It end) |
Identify a sequence of coco::Bag * as subnet's outputs. | |
template<typename T > | |
void | identifyOutputs (T &&values) |
coco::Bag * | input (uint32_t n) const |
coco::Bag * | output (uint32_t n) const |
bool | associated (coco::Bag *b) const |
Return true if a given bag has an associated operand in ANN IR. | |
ann::OperandID | operand (coco::Bag *b) const |
Return operand ID associated with a given bag. | |
|
inline |
|
inline |
Definition at line 75 of file Binder.h.
References morph::nnapi::as_tensor_shape(), and operand().
|
inline |
Definition at line 92 of file Binder.h.
References morph::nnapi::as_tensor_shape(), and operand().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Identify a sequence of coco::Bag * as subnet's inputs.
NOTE 1. This method takes input iterator over coco::Bag * values NOTE 2. All the identifyInputs class except the last one will be ignored if there are multiple identifyInputs calls
Definition at line 142 of file Binder.h.
Referenced by identifyInputs().
|
inline |
Definition at line 155 of file Binder.h.
References identifyInputs().
|
inline |
Identify a sequence of coco::Bag * as subnet's outputs.
NOTE 1. This method takes input iterator over coco::Bag * values NOTE 2. All the identifyOutputs class except the last one will be ignored if there are multiple identifyOutputs calls
Definition at line 168 of file Binder.h.
Referenced by identifyOutputs().
|
inline |
Definition at line 181 of file Binder.h.
References identifyOutputs().
|
inline |
Definition at line 187 of file Binder.h.
Referenced by enco::SubnetBlockCompiler::compile().
|
inline |
Definition at line 45 of file Binder.h.
Referenced by enco::SubnetStructBuilder::build(), and enco::SubnetBlockCompiler::compile().
|
inline |
Return operand ID associated with a given bag.
Definition at line 200 of file Binder.h.
References associated().
Referenced by addOperand(), and addOperand().
|
inline |
Definition at line 188 of file Binder.h.
Referenced by enco::SubnetBlockCompiler::compile().
|
inline |
|
inline |