From 43a799ca3ab5ffb60a381172dba2536ebb87708a Mon Sep 17 00:00:00 2001 From: Kevin May Date: Fri, 8 Feb 2019 16:31:42 +0000 Subject: IVGCVSW-2581 Create Deserializer * Add deserialize parser for input, output and add layers * Add Unit Tests for simple network Change-Id: Ia0e2a234896bbe401ed0da5f18c065cb5df51bfb Signed-off-by: Kevin May Signed-off-by: Saoirse Stewart --- .../armnnDeserializeParser/IDeserializeParser.hpp | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 include/armnnDeserializeParser/IDeserializeParser.hpp (limited to 'include/armnnDeserializeParser/IDeserializeParser.hpp') diff --git a/include/armnnDeserializeParser/IDeserializeParser.hpp b/include/armnnDeserializeParser/IDeserializeParser.hpp new file mode 100644 index 0000000000..bb9726e427 --- /dev/null +++ b/include/armnnDeserializeParser/IDeserializeParser.hpp @@ -0,0 +1,52 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// +#pragma once + +#include "armnn/Types.hpp" +#include "armnn/NetworkFwd.hpp" +#include "armnn/Tensor.hpp" +#include "armnn/INetwork.hpp" + +#include +#include +#include + +namespace armnnDeserializeParser +{ + +using BindingPointInfo = std::pair; + +class IDeserializeParser; +using IDeserializeParserPtr = std::unique_ptr; + +class IDeserializeParser +{ +public: + static IDeserializeParser* CreateRaw(); + static IDeserializeParserPtr Create(); + static void Destroy(IDeserializeParser* parser); + + /// Create the network from a flatbuffers binary file on disk + virtual armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile) = 0; + + /// Create the network from a flatbuffers binary + virtual armnn::INetworkPtr CreateNetworkFromBinary(const std::vector& binaryContent) = 0; + + + /// Retrieve binding info (layer id and tensor info) for the network input identified by + /// the given layer name and layers id + virtual BindingPointInfo GetNetworkInputBindingInfo(unsigned int layerId, + const std::string& name) const = 0; + + /// Retrieve binding info (layer id and tensor info) for the network output identified by + /// the given layer name and layers id + virtual BindingPointInfo GetNetworkOutputBindingInfo(unsigned int layerId, + const std::string& name) const = 0; + +protected: + virtual ~IDeserializeParser() {}; + +}; +} \ No newline at end of file -- cgit v1.2.1