diff options
author | Kevin May <kevin.may@arm.com> | 2019-02-08 16:31:42 +0000 |
---|---|---|
committer | Saoirse Stewart Arm <saoirse.stewart@arm.com> | 2019-02-11 09:25:03 +0000 |
commit | 43a799ca3ab5ffb60a381172dba2536ebb87708a (patch) | |
tree | e50a86c603003f75ef56041809ed7517a3a8772b /include | |
parent | c602f29d57f34b6bf0805d379b2174667d8bf52f (diff) | |
download | armnn-43a799ca3ab5ffb60a381172dba2536ebb87708a.tar.gz |
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 <kevin.may@arm.com>
Signed-off-by: Saoirse Stewart <saoirse.stewart@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/armnnDeserializeParser/IDeserializeParser.hpp | 52 |
1 files changed, 52 insertions, 0 deletions
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 <memory> +#include <map> +#include <vector> + +namespace armnnDeserializeParser +{ + +using BindingPointInfo = std::pair<armnn::LayerBindingId, armnn::TensorInfo>; + +class IDeserializeParser; +using IDeserializeParserPtr = std::unique_ptr<IDeserializeParser, void(*)(IDeserializeParser* parser)>; + +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<uint8_t>& 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 |