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

#include <Dump.h>

Collaboration diagram for circleinspect::DumpOperatorVersion:

Public Member Functions

 DumpOperatorVersion ()=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 54 of file Dump.h.

Constructor & Destructor Documentation

◆ DumpOperatorVersion()

circleinspect::DumpOperatorVersion::DumpOperatorVersion ( )
default

Member Function Documentation

◆ run()

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

Implements circleinspect::DumpInterface.

Definition at line 150 of file Dump.cpp.

152{
153 std::map<std::string, int32_t> op_version_map;
154
155 mio::circle::Reader reader(model, data);
156
157 // This assert is subject to be changed later
158 assert(reader.num_subgraph() == 1);
159 reader.select_subgraph(0);
160
161 auto ops = reader.operators();
162
163 // Dump operators' version
164 for (uint32_t i = 0; i < ops->size(); ++i)
165 {
166 const auto op = ops->Get(i);
167
168 auto op_name = reader.opcode_name(op);
169 auto op_version = reader.opcodes().at(op->opcode_index())->version();
170
171 if (op_version_map.find(op_name) == op_version_map.end() ||
172 op_version_map[op_name] < op_version)
173 op_version_map[op_name] = op_version;
174 }
175
176 for (auto op : op_version_map)
177 {
178 os << op.first << "," << op.second << std::endl;
179 }
180}
Loads Circle file and provides helpers to access attributes.
Definition Reader.h:39

References mio::circle::Reader::num_subgraph(), mio::circle::Reader::opcode_name(), mio::circle::Reader::opcodes(), mio::circle::Reader::operators(), and mio::circle::Reader::select_subgraph().

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


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