aboutsummaryrefslogtreecommitdiff
path: root/src/armnnSerializer
diff options
context:
space:
mode:
authorNattapat Chaimanowong <nattapat.chaimanowong@arm.com>2019-01-30 13:33:11 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-01-30 14:56:40 +0000
commit969eea33b0d4f4eaea17d67515f4a2af5ac20a9c (patch)
tree1217106c92416b3785b231febfd9d4c5e337cfab /src/armnnSerializer
parentadddddb6cbcb777d92a8c464c9ad0cb9aecc76a3 (diff)
downloadarmnn-969eea33b0d4f4eaea17d67515f4a2af5ac20a9c.tar.gz
IVGCVSW-2579 Create Flatbuffers schema for simple Armnn network
Change-Id: Ief6b1891a362f0f9bc3d388634ec551ab742503d
Diffstat (limited to 'src/armnnSerializer')
-rw-r--r--src/armnnSerializer/Schema.fbs111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/armnnSerializer/Schema.fbs b/src/armnnSerializer/Schema.fbs
new file mode 100644
index 0000000000..5941d1acea
--- /dev/null
+++ b/src/armnnSerializer/Schema.fbs
@@ -0,0 +1,111 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+namespace armnn.armnnSerializer;
+
+file_identifier "ARMN";
+
+file_extension "armnn";
+
+enum DataType : byte {
+ Float16 = 0,
+ Float32 = 1,
+ QuantisedAsymm8 = 2,
+ Signed32 = 3,
+ Boolean = 4
+}
+
+table TensorInfo {
+ dimensions:[uint];
+ dataType:DataType;
+ quantizationScale:float = 1.0;
+ quantizationOffset:int = 0;
+}
+
+struct Connection {
+ sourceLayerIndex:uint;
+ outputSlotIndex:uint;
+}
+
+table ByteData {
+ data:[byte];
+}
+
+table ShortData {
+ data:[short];
+}
+
+table IntData {
+ data:[int];
+}
+
+table LongData {
+ data:[long];
+}
+
+union ConstTensorData { ByteData, ShortData, IntData, LongData }
+
+table ConstTensor {
+ info:TensorInfo;
+ data:ConstTensorData;
+}
+
+table InputSlot {
+ index:uint;
+ connection:Connection;
+}
+
+table OutputSlot {
+ index:uint;
+ tensorInfo:TensorInfo;
+}
+
+enum LayerType : uint {
+ Addition = 0,
+ Input = 1,
+ Output = 2
+}
+
+// Base layer table to be used as part of other layers
+table LayerBase {
+ index:uint;
+ layerName:string;
+ layerType:LayerType;
+ inputSlots:[InputSlot];
+ outputSlots:[OutputSlot];
+}
+
+table BindableLayerBase {
+ base:LayerBase;
+ layerBindingId:int;
+}
+
+// Table for each layer defined below
+table AdditionLayer {
+ base:LayerBase;
+}
+
+table InputLayer {
+ base:BindableLayerBase;
+}
+
+table OutputLayer {
+ base:BindableLayerBase;
+}
+
+union Layer {
+ AdditionLayer,
+ InputLayer,
+ OutputLayer
+}
+
+// Root type for serialized data is the graph of the network
+table SerializedGraph {
+ layers:[Layer];
+ inputIds:[int];
+ outputIds:[int];
+}
+
+root_type SerializedGraph;