blob: 5941d1aceae797b993dc7371c48f32cca08a0ce2 [file] [log] [blame]
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6namespace armnn.armnnSerializer;
7
8file_identifier "ARMN";
9
10file_extension "armnn";
11
12enum DataType : byte {
13 Float16 = 0,
14 Float32 = 1,
15 QuantisedAsymm8 = 2,
16 Signed32 = 3,
17 Boolean = 4
18}
19
20table TensorInfo {
21 dimensions:[uint];
22 dataType:DataType;
23 quantizationScale:float = 1.0;
24 quantizationOffset:int = 0;
25}
26
27struct Connection {
28 sourceLayerIndex:uint;
29 outputSlotIndex:uint;
30}
31
32table ByteData {
33 data:[byte];
34}
35
36table ShortData {
37 data:[short];
38}
39
40table IntData {
41 data:[int];
42}
43
44table LongData {
45 data:[long];
46}
47
48union ConstTensorData { ByteData, ShortData, IntData, LongData }
49
50table ConstTensor {
51 info:TensorInfo;
52 data:ConstTensorData;
53}
54
55table InputSlot {
56 index:uint;
57 connection:Connection;
58}
59
60table OutputSlot {
61 index:uint;
62 tensorInfo:TensorInfo;
63}
64
65enum LayerType : uint {
66 Addition = 0,
67 Input = 1,
68 Output = 2
69}
70
71// Base layer table to be used as part of other layers
72table LayerBase {
73 index:uint;
74 layerName:string;
75 layerType:LayerType;
76 inputSlots:[InputSlot];
77 outputSlots:[OutputSlot];
78}
79
80table BindableLayerBase {
81 base:LayerBase;
82 layerBindingId:int;
83}
84
85// Table for each layer defined below
86table AdditionLayer {
87 base:LayerBase;
88}
89
90table InputLayer {
91 base:BindableLayerBase;
92}
93
94table OutputLayer {
95 base:BindableLayerBase;
96}
97
98union Layer {
99 AdditionLayer,
100 InputLayer,
101 OutputLayer
102}
103
104// Root type for serialized data is the graph of the network
105table SerializedGraph {
106 layers:[Layer];
107 inputIds:[int];
108 outputIds:[int];
109}
110
111root_type SerializedGraph;