ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Driver.cpp File Reference
#include <arser/arser.h>
#include <foder/FileLoader.h>
#include <tfldump/Dump.h>
#include <iostream>

Go to the source code of this file.

Functions

int entry (int argc, char **argv)
 Dump IR for given arguments.
 

Function Documentation

◆ entry()

int entry ( int  argc,
char **  argv 
)

Dump IR for given arguments.

Call example: $ ./build/compiler/encodump/encodump \ –frontend build/compiler/enco/frontend/caffe/libenco_caffe_frontend.so \ –frontend-arg build/compiler/enco/test/caffe/Convolution_003.prototxt \ –frontend-arg build/compiler/enco/test/caffe/Convolution_003.caffemodel

HDF5 layout is like below

GROUP "/" ㄴGROUP "name" ㄴATTRIBUTE "0" ㄴDATA (0): "input_01:0" ㄴATTRIBUTE "1" ㄴDATA (0): "input_02:0" ㄴGROUP "value" ㄴDATASET "0" ㄴDATA ... ㄴDATASET "1" ㄴDATA ...

Definition at line 23 of file Driver.cpp.

24{
26 arser.add_argument("tflite").help("TFLite file to dump");
27
28 try
29 {
30 arser.parse(argc, argv);
31 }
32 catch (const std::runtime_error &err)
33 {
34 std::cout << err.what() << '\n';
35 std::cout << arser;
36 return 255;
37 }
38
39 std::string tflite_path = arser.get<std::string>("tflite");
40 // Load TF lite model from a tflite file
41 foder::FileLoader fileLoader{tflite_path};
42 std::vector<char> modelData = fileLoader.load();
43 const tflite::Model *tflmodel = tflite::GetModel(modelData.data());
44 if (tflmodel == nullptr)
45 {
46 std::cerr << "ERROR: Failed to load tflite '" << tflite_path << "'" << std::endl;
47 return 255;
48 }
49
50 std::cout << "Dump: " << tflite_path << std::endl << std::endl;
51
52 tfldump::ModelEx modelex;
53 modelex.model = tflmodel;
54 modelex.rawdata = &modelData;
55
56 std::cout << modelex << std::endl;
57
58 return 0;
59}
DataBuffer load(void) const
Definition FileLoader.h:39
Definition arser.h:39
const std::vector< char > * rawdata
Definition Dump.h:30
const tflite::Model * model
Definition Dump.h:29

References foder::FileLoader::load(), tfldump::ModelEx::model, and tfldump::ModelEx::rawdata.