Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / compiler / circle-tensordump / README.md
1 # circle-tensordump
2
3 _circle-tensordump_ allows users to retrieve tensor information from a Circle model file
4
5 ## options
6
7 **--tensors**
8
9 dump tensors in circle file
10
11 ```
12 $ ./circle-tensordump --tensors ../luci/tests/Conv2D_000.circle
13                       
14 ----------------------------------------------------------------------
15 [ifm]
16  └── shape : (1, 3, 3, 2)
17
18 ----------------------------------------------------------------------
19 [ker]
20  ├── shape : (1, 1, 1, 2)
21  └── buffer
22      ├── index : 3
23      ├── size  : 8
24      └── data  : 0.727939, 0.320132, 
25
26 ----------------------------------------------------------------------
27 [bias]
28  ├── shape : (1)
29  └── buffer
30      ├── index : 4
31      ├── size  : 4
32      └── data  : -0.794465, 
33
34 ----------------------------------------------------------------------
35 [ofm]
36  └── shape : (1, 3, 3, 1)
37 ```
38
39 **--tensors_to_hdf5**
40
41 dump tensors in circle file to hdf5 file
42
43 ```
44 $ ./circle-tensordump --tensors_to_hdf5 ../luci/tests/Conv2D_000.circle output_path.h5
45 $ h5dump output_path.h5
46
47 HDF5 "output_path.h5" {
48 GROUP "/" {
49    GROUP "bias" {
50       DATASET "weights" {
51          DATATYPE  H5T_IEEE_F32LE
52          DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
53          DATA {
54          (0): -0.794465
55          }
56       }
57    }
58    GROUP "ifm" {
59    }
60    GROUP "ker" {
61       DATASET "weights" {
62          DATATYPE  H5T_IEEE_F32LE
63          DATASPACE  SIMPLE { ( 1, 1, 1, 2 ) / ( 1, 1, 1, 2 ) }
64          DATA {
65          (0,0,0,0): 0.727939, 0.320132
66          }
67       }
68    }
69    GROUP "ofm" {
70    }
71 }
72 }
73 ```