From 969eea33b0d4f4eaea17d67515f4a2af5ac20a9c Mon Sep 17 00:00:00 2001 From: Nattapat Chaimanowong Date: Wed, 30 Jan 2019 13:33:11 +0000 Subject: IVGCVSW-2579 Create Flatbuffers schema for simple Armnn network Change-Id: Ief6b1891a362f0f9bc3d388634ec551ab742503d --- src/armnnSerializer/Schema.fbs | 111 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/armnnSerializer/Schema.fbs (limited to 'src/armnnSerializer/Schema.fbs') 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; -- cgit v1.2.1