ONE - On-device Neural Engine
Loading...
Searching...
No Matches
exo::circle_detail::SerializedModelData Struct Referencefinal

#include <CircleExporterUtils.h>

Collaboration diagram for exo::circle_detail::SerializedModelData:

Public Member Functions

 SerializedModelData ()=default
 
 SerializedModelData (const SerializedModelData &)=delete
 
uint32_t registerBuiltinOpcode (circle::BuiltinOperator builtin_code)
 if opcode is not registered in table of opcodes add it
 
uint32_t registerCustomOpcode (const std::string &custom_op)
 

Data Fields

std::unordered_map< OpCode, uint32_t > _operator_codes
 
std::unordered_map< OpCode, std::string > _custom_operator_codes
 
std::vector< flatbuffers::Offset< circle::Operator > > _operators
 
std::vector< flatbuffers::Offset< circle::Tensor > > _tensors
 
std::vector< flatbuffers::Offset< circle::Buffer > > _buffers
 
std::unordered_map< loco::Pull *, std::string > _pull_to_name
 
std::unordered_map< loco::Push *, std::string > _push_to_name
 
- Data Fields inherited from exo::circle_detail::SubGraphContext
std::vector< int32_t > _inputs
 SubGraph input tensor id.
 
std::vector< int32_t > _outputs
 SubGraph output tensor id.
 
circle::DataFormat _data_format {circle::DataFormat::DataFormat_CHANNELS_LAST}
 @DataFormat for SubGraph
 

Detailed Description

Definition at line 81 of file CircleExporterUtils.h.

Constructor & Destructor Documentation

◆ SerializedModelData() [1/2]

exo::circle_detail::SerializedModelData::SerializedModelData ( )
default

◆ SerializedModelData() [2/2]

exo::circle_detail::SerializedModelData::SerializedModelData ( const SerializedModelData )
delete

Member Function Documentation

◆ registerBuiltinOpcode()

uint32_t exo::circle_detail::SerializedModelData::registerBuiltinOpcode ( circle::BuiltinOperator  builtin_code)

if opcode is not registered in table of opcodes add it

Parameters
builtin_code
Returns
idx of opcode in table of opcodes (see schema)

Definition at line 46 of file CircleExporterUtils.cpp.

47{
48 auto it = _operator_codes.find(OpCode{builtin_code});
49 if (it != _operator_codes.end())
50 {
51 return it->second;
52 }
53 auto idx = static_cast<uint32_t>(_operator_codes.size());
54 _operator_codes.emplace(OpCode{builtin_code}, idx);
55 return idx;
56}
std::unordered_map< OpCode, uint32_t > _operator_codes

References _operator_codes.

Referenced by registerCustomOpcode().

◆ registerCustomOpcode()

uint32_t exo::circle_detail::SerializedModelData::registerCustomOpcode ( const std::string &  custom_op)

Definition at line 58 of file CircleExporterUtils.cpp.

59{
60 circle::BuiltinOperator custom_code = circle::BuiltinOperator_CUSTOM;
61 auto idx = registerBuiltinOpcode(custom_code);
62 _custom_operator_codes.emplace(OpCode{custom_code}, custom_op);
63 return idx;
64}
uint32_t registerBuiltinOpcode(circle::BuiltinOperator builtin_code)
if opcode is not registered in table of opcodes add it
std::unordered_map< OpCode, std::string > _custom_operator_codes

References _custom_operator_codes, and registerBuiltinOpcode().

Field Documentation

◆ _buffers

std::vector<flatbuffers::Offset<circle::Buffer> > exo::circle_detail::SerializedModelData::_buffers

◆ _custom_operator_codes

std::unordered_map<OpCode, std::string> exo::circle_detail::SerializedModelData::_custom_operator_codes

Definition at line 87 of file CircleExporterUtils.h.

Referenced by registerCustomOpcode().

◆ _operator_codes

std::unordered_map<OpCode, uint32_t> exo::circle_detail::SerializedModelData::_operator_codes

Definition at line 86 of file CircleExporterUtils.h.

Referenced by registerBuiltinOpcode().

◆ _operators

std::vector<flatbuffers::Offset<circle::Operator> > exo::circle_detail::SerializedModelData::_operators

Definition at line 88 of file CircleExporterUtils.h.

◆ _pull_to_name

std::unordered_map<loco::Pull *, std::string> exo::circle_detail::SerializedModelData::_pull_to_name

Definition at line 93 of file CircleExporterUtils.h.

Referenced by exo::circle_detail::registerGraphIOName().

◆ _push_to_name

std::unordered_map<loco::Push *, std::string> exo::circle_detail::SerializedModelData::_push_to_name

Definition at line 94 of file CircleExporterUtils.h.

Referenced by exo::circle_detail::registerGraphIOName().

◆ _tensors

std::vector<flatbuffers::Offset<circle::Tensor> > exo::circle_detail::SerializedModelData::_tensors

Definition at line 89 of file CircleExporterUtils.h.

Referenced by exo::circle_detail::exportOpDefinedTensor().


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