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

#include <Dump.h>

Collaboration diagram for circleinspect::DumpTensorShape:

Public Member Functions

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

Constructor & Destructor Documentation

◆ DumpTensorShape()

circleinspect::DumpTensorShape::DumpTensorShape ( )
default

Member Function Documentation

◆ run()

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

Implements circleinspect::DumpInterface.

Definition at line 247 of file Dump.cpp.

249{
250 mio::circle::Reader reader(model, data);
251
252 const uint32_t subgraph_size = reader.num_subgraph();
253
254 for (uint32_t g = 0; g < subgraph_size; g++)
255 {
256 reader.select_subgraph(g);
257 auto tensors = reader.tensors();
258
259 for (uint32_t i = 0; i < tensors->size(); ++i)
260 {
261 const auto tensor = tensors->Get(i);
262 auto shape = tensor->shape_signature() ? tensor->shape_signature() : tensor->shape();
263 os << reader.tensor_name(tensor) << " [";
264 for (uint32_t i = 0; i < shape->size(); i++)
265 {
266 os << shape->Get(i);
267 if (i != shape->size() - 1)
268 {
269 os << ",";
270 }
271 }
272 os << "]" << std::endl;
273 }
274 }
275}
Loads Circle file and provides helpers to access attributes.
Definition Reader.h:39

References 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: