ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci_interpreter::CircleReader Class Reference

Loads Circle file and provides helpers to access attributes. More...

#include <CircleMicroReader.h>

Public Types

using CircleBuffers = VectorWrapper< flatbuffers::Offset< circle::Buffer > >
 
using CircleTensors = VectorWrapper< flatbuffers::Offset< circle::Tensor > >
 
using CircleOperators = VectorWrapper< flatbuffers::Offset< circle::Operator > >
 
using CircleOperatorCodes = VectorWrapper< flatbuffers::Offset< circle::OperatorCode > >
 
using CircleMetadataSet = VectorWrapper< flatbuffers::Offset< circle::Metadata > >
 

Public Member Functions

 CircleReader ()=default
 
CircleOperatorCodes opcodes () const
 
CircleBuffers buffers () const
 
CircleTensors tensors () const
 
CircleOperators operators () const
 
VectorWrapper< int32_t > inputs () const
 
VectorWrapper< int32_t > outputs () const
 
circle::DataFormat data_format () const
 
CircleMetadataSet metadata () const
 
uint32_t num_subgraph () const
 
circle::BuiltinOperator builtin_code (const circle::Operator *op) const
 
bool parse (const circle::Model *model)
 
bool select_subgraph (uint32_t subgraph)
 
uint32_t get_current_subgraph_index () const
 

Detailed Description

Loads Circle file and provides helpers to access attributes.

Definition at line 154 of file CircleMicroReader.h.

Member Typedef Documentation

◆ CircleBuffers

◆ CircleMetadataSet

◆ CircleOperatorCodes

◆ CircleOperators

◆ CircleTensors

Constructor & Destructor Documentation

◆ CircleReader()

luci_interpreter::CircleReader::CircleReader ( )
default

Member Function Documentation

◆ buffers()

CircleBuffers luci_interpreter::CircleReader::buffers ( ) const
inline

Definition at line 168 of file CircleMicroReader.h.

168{ return wrap(_model->buffers()); }
VectorWrapper< T > wrap(const flatbuffers::Vector< T > *vec)

References luci::wrap().

◆ builtin_code()

circle::BuiltinOperator luci_interpreter::CircleReader::builtin_code ( const circle::Operator *  op) const

◆ data_format()

circle::DataFormat luci_interpreter::CircleReader::data_format ( ) const
inline

Definition at line 173 of file CircleMicroReader.h.

173{ return _current_subgraph->data_format(); }

◆ get_current_subgraph_index()

uint32_t luci_interpreter::CircleReader::get_current_subgraph_index ( ) const
inline

Definition at line 182 of file CircleMicroReader.h.

182{ return _current_subgraph_index; }

◆ inputs()

VectorWrapper< int32_t > luci_interpreter::CircleReader::inputs ( ) const
inline

Definition at line 171 of file CircleMicroReader.h.

171{ return wrap(_current_subgraph->inputs()); }

References luci::wrap().

Referenced by validate_onnx2circle.OnnxRunner::feed_random_inputs(), and package.infer.session::set_inputs().

◆ metadata()

CircleMetadataSet luci_interpreter::CircleReader::metadata ( ) const
inline

Definition at line 174 of file CircleMicroReader.h.

174{ return wrap(_model->metadata()); }

References luci::wrap().

◆ num_subgraph()

uint32_t luci_interpreter::CircleReader::num_subgraph ( ) const
inline

Definition at line 176 of file CircleMicroReader.h.

176{ return wrap(_model->subgraphs()).size(); }

References luci::wrap().

◆ opcodes()

CircleOperatorCodes luci_interpreter::CircleReader::opcodes ( ) const
inline

Definition at line 167 of file CircleMicroReader.h.

167{ return wrap(_model->operator_codes()); }

References luci::wrap().

◆ operators()

CircleOperators luci_interpreter::CircleReader::operators ( ) const
inline

Definition at line 170 of file CircleMicroReader.h.

170{ return wrap(_current_subgraph->operators()); }

References luci::wrap().

◆ outputs()

VectorWrapper< int32_t > luci_interpreter::CircleReader::outputs ( ) const
inline

Definition at line 172 of file CircleMicroReader.h.

172{ return wrap(_current_subgraph->outputs()); }

References luci::wrap().

Referenced by validate_onnx2circle.OnnxRunner::get_outputs(), package.infer.session::inference(), and package.infer.session::set_outputs().

◆ parse()

bool luci_interpreter::CircleReader::parse ( const circle::Model *  model)

◆ select_subgraph()

bool luci_interpreter::CircleReader::select_subgraph ( uint32_t  subgraph)

◆ tensors()

CircleTensors luci_interpreter::CircleReader::tensors ( ) const
inline

Definition at line 169 of file CircleMicroReader.h.

169{ return wrap(_current_subgraph->tensors()); }

References luci::wrap().


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