ONE - On-device Neural Engine
Loading...
Searching...
No Matches
circleinspect::DumpConstants Class Referencefinal

#include <Dump.h>

Collaboration diagram for circleinspect::DumpConstants:

Public Member Functions

 DumpConstants ()=default
 
void run (std::ostream &os, const circle::Model *model, const std::vector< char > *data)
 
- Public Member Functions inherited from circleinspect::DumpInterface
virtual ~DumpInterface ()=default
 

Detailed Description

Definition at line 72 of file Dump.h.

Constructor & Destructor Documentation

◆ DumpConstants()

circleinspect::DumpConstants::DumpConstants ( )
default

Member Function Documentation

◆ run()

void circleinspect::DumpConstants::run ( std::ostream &  os,
const circle::Model *  model,
const std::vector< char > *  data 
)
virtual

Implements circleinspect::DumpInterface.

Definition at line 213 of file Dump.cpp.

214{
215 mio::circle::Reader reader(model, data);
216
217 const uint32_t subgraph_size = reader.num_subgraph();
218
219 for (uint32_t g = 0; g < subgraph_size; g++)
220 {
221 reader.select_subgraph(g);
222 auto tensors = reader.tensors();
223
224 for (uint32_t i = 0; i < tensors->size(); ++i)
225 {
226 const auto tensor = tensors->Get(i);
227 if (tensor->is_variable())
228 continue;
229
230 auto const buffer_id = tensor->buffer();
231 bool ext_offset = false;
232
233 auto const buffer_size = reader.buffer_info(buffer_id, nullptr, ext_offset);
234 if (buffer_size == 0)
235 continue;
236
237 os << reader.tensor_name(tensor) << std::endl;
238 }
239 }
240}
Loads Circle file and provides helpers to access attributes.
Definition Reader.h:39

References mio::circle::Reader::buffer_info(), mio::circle::Reader::num_subgraph(), mio::circle::Reader::select_subgraph(), mio::circle::Reader::tensor_name(), and mio::circle::Reader::tensors().

Referenced by package.infer.session::inference().


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