Definition at line 116 of file CircleInterpreter_cffi.cpp.
◆ InterpreterWrapper()
InterpreterWrapper::InterpreterWrapper |
( |
const uint8_t * |
data, |
|
|
const size_t |
data_size |
|
) |
| |
|
inlineexplicit |
Definition at line 119 of file CircleInterpreter_cffi.cpp.
120 {
122 _module = importer.importModule(data, data_size);
123 if (_module == nullptr)
124 {
125 throw std::runtime_error{"Cannot import module."};
126 }
128 }
◆ ~InterpreterWrapper()
InterpreterWrapper::~InterpreterWrapper |
( |
| ) |
|
|
inline |
◆ interpret()
void InterpreterWrapper::interpret |
( |
void |
| ) |
|
|
inline |
◆ readOutputTensor()
void InterpreterWrapper::readOutputTensor |
( |
const int |
output_idx, |
|
|
void * |
output, |
|
|
size_t |
output_size |
|
) |
| |
|
inline |
Definition at line 149 of file CircleInterpreter_cffi.cpp.
150 {
153 loco::must_cast<const luci::CircleOutput *>(
output_nodes.at(output_idx));
154 const auto fb_output_size = ::getTensorSize(output_node);
155 if (fb_output_size != output_size)
156 {
157 const auto msg = "Invalid output size: " + std::to_string(fb_output_size) +
158 " != " + std::to_string(output_size);
159 throw std::runtime_error(msg);
160 }
162 }
void readOutputTensor(const luci::CircleOutput *output_node, void *data, size_t data_size)
std::vector< Node * > output_nodes(Graph *)
CircleOutput * output_node(loco::Graph *g, const loco::GraphOutputIndex &index)
Find a CircleOutput node with a given output index.
References loco::output_nodes(), and luci_interpreter::Interpreter::readOutputTensor().
◆ writeInputTensor()
void InterpreterWrapper::writeInputTensor |
( |
const int |
input_idx, |
|
|
const void * |
data, |
|
|
size_t |
input_size |
|
) |
| |
|
inline |
Definition at line 134 of file CircleInterpreter_cffi.cpp.
135 {
138
139 const auto fb_input_size = ::getTensorSize(input_node);
140 if (fb_input_size != input_size)
141 {
142 const auto msg = "Invalid input size: " + std::to_string(fb_input_size) +
143 " != " + std::to_string(input_size);
144 throw std::runtime_error(msg);
145 }
147 }
void writeInputTensor(const luci::CircleInput *input_node, const void *data, size_t data_size)
std::vector< Node * > input_nodes(const Graph *)
CircleInput * input_node(loco::Graph *g, const loco::GraphInputIndex &index)
Find a Pull node with a given input index.
References loco::input_nodes(), and luci_interpreter::Interpreter::writeInputTensor().
The documentation for this class was generated from the following file: