ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Driver.cpp File Reference
#include "H5Writer.h"
#include <arser/arser.h>

Go to the source code of this file.

Functions

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

Function Documentation

◆ entry()

int entry ( const 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{
25 arser::Arser arser("Generate min/max data to test minmax-embedder");
26 arser.add_argument("--num_inputs")
27 .type(arser::DataType::INT32)
28 .default_value(1)
29 .help("number of input layers (default:1)");
30 arser.add_argument("--num_ops")
31 .type(arser::DataType::INT32)
32 .default_value(1)
33 .help("number of operators (default:1)");
34 arser.add_argument("minmax").help("path to generated minmax data");
35
36 try
37 {
38 arser.parse(argc, argv);
39 }
40 catch (const std::runtime_error &err)
41 {
42 std::cout << err.what() << std::endl;
43 std::cout << arser;
44 return 255;
45 }
46
47 auto num_inputs = arser.get<int>("--num_inputs");
48 auto num_ops = arser.get<int>("--num_ops");
49 auto data_output_path = arser.get<std::string>("minmax");
50
51 ModelSpec mspec;
52 {
53 if (num_inputs <= 0 || num_ops <= 0)
54 {
55 std::cout << "num_inputs and num_ops must be positive integers." << std::endl;
56 return 255;
57 }
58 mspec.n_inputs = num_inputs;
59 mspec.n_ops = num_ops;
60 }
61 H5Writer writer(mspec, data_output_path);
62 writer.dump();
63
64 return EXIT_SUCCESS;
65}
Definition arser.h:39

References minmax_embedder_test::H5Writer::dump(), and minmax_embedder_test::ModelSpec::n_inputs.