#include <ONNXUtils/ONNXWrapper.h>
#include <iostream>
Go to the source code of this file.
|
| int | main (int narg, char *argv[]) |
◆ main()
| int main |
( |
int | narg, |
|
|
char * | argv[] ) |
Definition at line 4 of file extract-onnx-metadata.cxx.
4 {
5 std::cout<<narg;
6 if (narg != 3 && narg != 2) {
7 std::cout <<
"usage: " <<
argv[0] <<
" <onnx_file> [key]" << std::endl;
8 return 1;
9 }
10
12
13
14
15 if (narg == 2) {
16
17 for (
const auto &p :
model->GetModelInputs() )
18 {
19 std::string separator;
20 std::cout <<
"Input: " <<
p.first <<
", shape: (";
21 for (
auto x :
p.second) {
22 std::cout << separator <<
x;
23 separator = ",";
24 }
25 std::cout << ")" << std::endl;
26 }
27 for (
const auto &p :
model->GetModelOutputs() )
28 {
29 std::string separator;
30 std::cout <<
"Outputs: " <<
p.first <<
", shape: (";
31 for (
auto x :
p.second) {
32 std::cout << separator <<
x;
33 separator = ",";
34 }
35 std::cout << ")" << std::endl;
36 }
37 for (
const auto &p :
model->GetMETAData() )
38 {
39 std::cout <<
"META data: "<<
p.first <<
'\t' <<
p.second.at(0) << std::endl;
40 }
41
43 return 2;
44 }
45
46
47 std::cout <<
model->GetMETADataByKey(argv[2]) << std::endl;
49
50 return 0;
51}