aboutsummaryrefslogtreecommitdiff
path: root/src/armnnDeserializer/Deserializer.hpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2019-02-21 16:29:43 +0000
committerderek.lamberti <derek.lamberti@arm.com>2019-02-22 09:57:45 +0000
commit8ddae33ada66cc2ecdc0cde7799d81dda7532fb5 (patch)
tree3f835fe51cd00ddd1660e431b29db65991c66b06 /src/armnnDeserializer/Deserializer.hpp
parentc64ea9fdf975a65e9a1dd67b44469add270d6f8b (diff)
downloadarmnn-8ddae33ada66cc2ecdc0cde7799d81dda7532fb5.tar.gz
IVGSVSW-2736 Fix dangling reference to temporary storage
Change-Id: Ie6c553798eac732f37148d81970366e5a4ede1be Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/armnnDeserializer/Deserializer.hpp')
-rw-r--r--src/armnnDeserializer/Deserializer.hpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/armnnDeserializer/Deserializer.hpp b/src/armnnDeserializer/Deserializer.hpp
index 25c651a50b..d1cb17d3af 100644
--- a/src/armnnDeserializer/Deserializer.hpp
+++ b/src/armnnDeserializer/Deserializer.hpp
@@ -44,7 +44,6 @@ public:
public:
// testable helpers
static GraphPtr LoadGraphFromBinary(const uint8_t* binaryContent, size_t len);
- static GraphPtr LoadGraphFromBinary(std::istream& binaryContent);
static TensorRawPtrVector GetInputs(const GraphPtr& graph, unsigned int layerIndex);
static TensorRawPtrVector GetOutputs(const GraphPtr& graph, unsigned int layerIndex);
static LayerBaseRawPtrVector GetGraphInputs(const GraphPtr& graphPtr);
@@ -62,40 +61,43 @@ private:
Deserializer& operator=(const Deserializer&) = delete;
/// Create the network from an already loaded flatbuffers graph
- armnn::INetworkPtr CreateNetworkFromGraph();
+ armnn::INetworkPtr CreateNetworkFromGraph(GraphPtr graph);
// signature for the parser functions
- using LayerParsingFunction = void(Deserializer::*)(unsigned int layerIndex);
-
- void ParseUnsupportedLayer(unsigned int layerIndex);
- void ParseActivation(unsigned int layerIndex);
- void ParseAdd(unsigned int layerIndex);
- void ParseConvolution2d(unsigned int layerIndex);
- void ParseDepthwiseConvolution2d(unsigned int layerIndex);
- void ParseFullyConnected(unsigned int layerIndex);
- void ParseMultiplication(unsigned int layerIndex);
- void ParsePermute(unsigned int layerIndex);
- void ParsePooling2d(unsigned int layerIndex);
- void ParseReshape(unsigned int layerIndex);
- void ParseSoftmax(unsigned int layerIndex);
+ using LayerParsingFunction = void(Deserializer::*)(GraphPtr graph, unsigned int layerIndex);
+
+ void ParseUnsupportedLayer(GraphPtr graph, unsigned int layerIndex);
+ void ParseActivation(GraphPtr graph, unsigned int layerIndex);
+ void ParseAdd(GraphPtr graph, unsigned int layerIndex);
+ void ParseConvolution2d(GraphPtr graph, unsigned int layerIndex);
+ void ParseDepthwiseConvolution2d(GraphPtr graph, unsigned int layerIndex);
+ void ParseFullyConnected(GraphPtr graph, unsigned int layerIndex);
+ void ParseMultiplication(GraphPtr graph, unsigned int layerIndex);
+ void ParsePermute(GraphPtr graph, unsigned int layerIndex);
+ void ParsePooling2d(GraphPtr graph, unsigned int layerIndex);
+ void ParseReshape(GraphPtr graph, unsigned int layerIndex);
+ void ParseSoftmax(GraphPtr graph, unsigned int layerIndex);
void RegisterOutputSlotOfConnection(uint32_t connectionIndex, armnn::IOutputSlot* slot);
void RegisterInputSlotOfConnection(uint32_t connectionIndex, armnn::IInputSlot* slot);
- void RegisterInputSlots(uint32_t layerIndex,
+ void RegisterInputSlots(GraphPtr graph, uint32_t layerIndex,
armnn::IConnectableLayer* layer);
- void RegisterOutputSlots(uint32_t layerIndex,
+ void RegisterOutputSlots(GraphPtr graph, uint32_t layerIndex,
armnn::IConnectableLayer* layer);
void ResetParser();
- void SetupInputLayers();
- void SetupOutputLayers();
+ void SetupInputLayers(GraphPtr graphPtr);
+ void SetupOutputLayers(GraphPtr graphPtr);
/// The network we're building. Gets cleared after it is passed to the user
armnn::INetworkPtr m_Network;
- GraphPtr m_Graph;
std::vector<LayerParsingFunction> m_ParserFunctions;
std::string m_layerName;
+ using NameToBindingInfo = std::pair<std::string, BindingPointInfo >;
+ std::vector<NameToBindingInfo> m_InputBindings;
+ std::vector<NameToBindingInfo> m_OutputBindings;
+
/// A mapping of an output slot to each of the input slots it should be connected to
/// The outputSlot is from the layer that creates this tensor as one of its outputs
/// The inputSlots are from the layers that use this tensor as one of their inputs