From 521032fd424cf86681eb125afbf5eaee47d8c585 Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Thu, 7 Oct 2021 11:46:40 +0100 Subject: IVGCVSW-6417: Catch AddFullyConnected API error when weights TensorInfo isn't set * Updated code in Graph.cpp InferTensorInfos() to be more descriptive. * Added method VerifyConstantLayerSetTensorInfo() in Graph.cpp/hpp to error when ConstantLayer TensorInfo is not set. * Updated Optimize() in Network.cpp to call VerifyConstantLayerSetTensorInfo(). * Added unit test with ConstantLayer TensorInfo not set to catch error in VerifyConstantLayerSetTensorInfo(). * Added comments around method VerifyConstantLayerSetTensorInfo(). Signed-off-by: Cathal Corbett Change-Id: I366596243f7c5823676222e2d0cce1335bc8c325 --- src/armnn/Graph.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/armnn/Graph.hpp') diff --git a/src/armnn/Graph.hpp b/src/armnn/Graph.hpp index 731ae1e5aa..d5fbeafed0 100644 --- a/src/armnn/Graph.hpp +++ b/src/armnn/Graph.hpp @@ -203,6 +203,10 @@ public: void SubstituteSubgraph(SubgraphView& subgraph, IConnectableLayer* substituteLayer); void SubstituteSubgraph(SubgraphView& subgraph, const SubgraphView& substituteSubgraph); + /// For each ConstantLayer in Graph, ensures TensorInfo is set on all output slots. + /// LayerValidationException thrown if no TensorInfo is set. + void VerifyConstantLayerSetTensorInfo() const; + void InferTensorInfos(); void AttachObservable(IGraphObservable* const observable, GraphEvent notifyOnEvent) { -- cgit v1.2.1