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

#include <SerializedData.h>

Collaboration diagram for luci::SerializedModelData:

Public Types

using BufferData = std::vector< uint8_t >
 
using MapBufferData = std::map< int32_t, BufferData >
 

Public Member Functions

 SerializedModelData ()=default
 
 SerializedModelData (const SerializedModelData &)=delete
 
uint32_t registerBuiltinOpcode (circle::BuiltinOperator builtin_code, const std::string &custom_code, const int32_t op_version)
 if opcode is not registered in table of opcodes add it
 
void clear (void)
 

Data Fields

std::unordered_map< OpCode, uint32_t > _operator_codes
 
std::vector< flatbuffers::Offset< circle::Buffer > > _buffers
 
flatbuffers::Offset< circle::Buffer > _empty_buffer
 
CircleExportMetadata _metadata
 
std::map< luci::CircleConst *, uint32_t > _cached_buffer_id
 
bool _ext_buffer = false
 
bool _require_ext_buffer = false
 
MapBufferData _buffer_data_map
 

Detailed Description

Definition at line 119 of file SerializedData.h.

Member Typedef Documentation

◆ BufferData

using luci::SerializedModelData::BufferData = std::vector<uint8_t>

Definition at line 137 of file SerializedData.h.

◆ MapBufferData

Definition at line 138 of file SerializedData.h.

Constructor & Destructor Documentation

◆ SerializedModelData() [1/2]

luci::SerializedModelData::SerializedModelData ( )
default

◆ SerializedModelData() [2/2]

luci::SerializedModelData::SerializedModelData ( const SerializedModelData )
delete

Member Function Documentation

◆ clear()

void luci::SerializedModelData::clear ( void  )

Definition at line 29 of file SerializedData.cpp.

30{
31 _operator_codes.clear();
32 _buffers.clear();
34 _cached_buffer_id.clear();
35
36 // clear extended buffer mode
37 _ext_buffer = false;
38 _require_ext_buffer = false;
39 _buffer_data_map.clear();
40}
std::map< luci::CircleConst *, uint32_t > _cached_buffer_id
std::unordered_map< OpCode, uint32_t > _operator_codes
std::vector< flatbuffers::Offset< circle::Buffer > > _buffers
CircleExportMetadata _metadata

References _buffer_data_map, _buffers, _cached_buffer_id, _ext_buffer, _metadata, _operator_codes, _require_ext_buffer, and luci::CircleExportMetadata::clear().

Referenced by luci::prepareModelData().

◆ registerBuiltinOpcode()

uint32_t luci::SerializedModelData::registerBuiltinOpcode ( circle::BuiltinOperator  builtin_code,
const std::string &  custom_code,
const int32_t  op_version 
)

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 233 of file CircleExporterUtils.cpp.

236{
237 assert(op_version > 0);
238
239 auto it = _operator_codes.find(OpCode{builtin_code, custom_code, op_version});
240 if (it != _operator_codes.end())
241 {
242 return it->second;
243 }
244 auto idx = static_cast<uint32_t>(_operator_codes.size());
245 _operator_codes.emplace(OpCode{builtin_code, custom_code, op_version}, idx);
246 return idx;
247}

References _operator_codes.

Referenced by luci::OperationExporterRule::visit().

Field Documentation

◆ _buffer_data_map

MapBufferData luci::SerializedModelData::_buffer_data_map

Definition at line 140 of file SerializedData.h.

Referenced by clear().

◆ _buffers

std::vector<flatbuffers::Offset<circle::Buffer> > luci::SerializedModelData::_buffers

Definition at line 125 of file SerializedData.h.

Referenced by clear(), and luci::prepareModelData().

◆ _cached_buffer_id

std::map<luci::CircleConst *, uint32_t> luci::SerializedModelData::_cached_buffer_id

Definition at line 130 of file SerializedData.h.

Referenced by clear().

◆ _empty_buffer

flatbuffers::Offset<circle::Buffer> luci::SerializedModelData::_empty_buffer

Definition at line 126 of file SerializedData.h.

Referenced by luci::prepareModelData().

◆ _ext_buffer

bool luci::SerializedModelData::_ext_buffer = false

Definition at line 133 of file SerializedData.h.

Referenced by clear().

◆ _metadata

CircleExportMetadata luci::SerializedModelData::_metadata

Definition at line 127 of file SerializedData.h.

Referenced by clear(), luci::createCircleMetadataVector(), and luci::exportNodes().

◆ _operator_codes

std::unordered_map<OpCode, uint32_t> luci::SerializedModelData::_operator_codes

Definition at line 124 of file SerializedData.h.

Referenced by clear(), and registerBuiltinOpcode().

◆ _require_ext_buffer

bool luci::SerializedModelData::_require_ext_buffer = false

Definition at line 135 of file SerializedData.h.

Referenced by clear().


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