ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ann::OperandInventory Class Reference

#include <OperandInventory.h>

Public Member Functions

OperandID create (const DType &)
 
OperandID create (const DType &, const nncc::core::ADT::tensor::Shape &)
 
template<typename Callable >
void each (Callable &&cb) const
 
Operandat (const OperandID &id)
 
const Operandat (const OperandID &id) const
 

Detailed Description

Definition at line 31 of file OperandInventory.h.

Member Function Documentation

◆ at() [1/2]

Operand * ann::OperandInventory::at ( const OperandID id)

Definition at line 50 of file OperandInventory.cpp.

50{ return _operands.at(id.value()).get(); }

◆ at() [2/2]

const Operand * ann::OperandInventory::at ( const OperandID id) const

Definition at line 52 of file OperandInventory.cpp.

53{
54 return _operands.at(id.value()).get();
55}

◆ create() [1/2]

OperandID ann::OperandInventory::create ( const DType dtype)

Definition at line 26 of file OperandInventory.cpp.

27{
28 uint32_t id = _operands.size();
29
30 auto operand = make_unique<ScalarOperand>();
31 operand->dtype(dtype);
32
33 _operands.emplace_back(std::move(operand));
34
35 return OperandID{id};
36}
DType dtype(void)

References ann::dtype().

◆ create() [2/2]

OperandID ann::OperandInventory::create ( const DType dtype,
const nncc::core::ADT::tensor::Shape shape 
)

Definition at line 38 of file OperandInventory.cpp.

39{
40 uint32_t id = _operands.size();
41
42 auto operand = make_unique<TensorOperand>(shape);
43 operand->dtype(dtype);
44
45 _operands.emplace_back(std::move(operand));
46
47 return OperandID{id};
48}

References ann::dtype().

◆ each()

template<typename Callable >
void ann::OperandInventory::each ( Callable &&  cb) const
inline

Definition at line 38 of file OperandInventory.h.

39 {
40 for (uint32_t n = 0; n < _operands.size(); ++n)
41 {
42 cb(OperandID{n}, _operands.at(n).get());
43 }
44 }
KnobTrait< K >::ValueType get(void)

Referenced by enco::SubnetStructBuilder::build().


The documentation for this class was generated from the following files: