From f24effa4995ea4c3dd91e33d4a2787e02decf8b4 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Fri, 3 Jul 2020 10:12:03 +0100 Subject: IVGCVSW-5155 Update Arm NN API to allow for call to shape inference Signed-off-by: Finn Williams Change-Id: I0a2babe5b5b09eb81c9900dc3a05071034a0440b --- src/armnn/Graph.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/armnn/Graph.cpp') diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp index cc3384748a..2a60072597 100644 --- a/src/armnn/Graph.cpp +++ b/src/armnn/Graph.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -489,7 +489,7 @@ void Graph::EraseSubgraphLayers(SubgraphView &subgraph) subgraph.Clear(); } -void Graph::InferTensorInfos(ShapeInferenceMethod shapeInferenceMethod) +void Graph::InferTensorInfos() { for (auto&& layer : TopologicalSort()) { @@ -511,8 +511,12 @@ void Graph::InferTensorInfos(ShapeInferenceMethod shapeInferenceMethod) { throw LayerValidationException("All inputs must have the TensorInfo set at this point."); } + + if (layer->m_ShapeInferenceMethod == ShapeInferenceMethod::ValidateOnly) + { + layer->ValidateTensorShapesFromInputs(); + } } - layer->ValidateTensorShapesFromInputs(shapeInferenceMethod); } } -- cgit v1.2.1