d2baf26b3750bd16949e90da346e4efadc55f70d
[platform/core/ml/nnfw.git] / compiler / circledump / README.md
1 # circledump
2
3 ### What is this?
4
5 circledump is a tool that dumps binary circle file into human readable text to console.
6
7 circledump is implemented with C++ not python. We can do the same thing much easier
8 with python but this tool doesn't need to install TensorFlow python package.
9
10 Schema for FlatBuffer used is from TensorFlow v1.13.1 release.
11
12 ### Design philosophy
13
14 Make the code simple.
15
16 ### To do
17
18 - Print weight values other than uint8_t
19 - Add more operators
20
21 ### How to use
22
23 Command argument format:
24 ```
25 circledump circle_file
26 ```
27
28 Example output of dump `readme.circle` file
29 ```
30 Dump: readme.circle
31
32 Data Format:
33 CHANNEL_LAST (NHWC for 2d, NDHWC for 3d data)
34
35 Operator Codes: [order] OpCodeName (OpCode Enum)
36 [0] CONV_2D (code: 3)
37
38 Buffers: B(index) (length) values, if any
39 B(0) (0)
40 B(1) (8) 0x94 0x5b 0x95 0xbf 0x42 0xa4 0x52 0xbf ...
41 B(2) (4) 0xcd 0xcc 0x8c 0x3f
42
43 Operands: T(tensor index) TYPE (shape) B(buffer index) OperandName
44 T(0) FLOAT32 (1, 3, 3, 2) B(0) ifm
45 T(1) FLOAT32 (1, 1, 1, 2) B(1) ker
46 T(2) FLOAT32 (1) B(2) bias
47 T(3) FLOAT32 (1, 3, 3, 1) B(0) ofm
48
49 Operators: O(operator index) OpCodeName
50     Option(values) ... <-- depending on OpCode
51     I T(tensor index) OperandName <-- as input
52     O T(tensor index) OperandName <-- as output
53 O(0) CONV_2D
54     Padding(1) Stride.W(1) Stride.H(1) Activation(0)
55     I T(0) ifm
56     I T(1) ker
57     I T(2) bias
58     O T(3) ofm
59
60 Inputs/Outputs: I(input)/O(output) T(tensor index) OperandName
61 I T(0) ifm
62 I T(1) ker
63 O T(3) ofm
64 ```
65
66 ### Dependency
67
68 - mio-circle04
69 - safemain
70 - FlatBuffers