From 9af1dcde23f778f99afd5497a4247a9c6cdfac30 Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Tue, 3 Dec 2019 15:46:50 +0000 Subject: MLCE-133 Fix dangling calls to Manage() * If nobody consumes an output tensor, the call to Manage() is not closed by a corresponding call to Allocate() Change-Id: I6af9cff7aa1b7eb70bcf691c00c0ce07b48e7527 Signed-off-by: Pablo Tello --- src/armnn/Graph.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp index fe6a7c8afa..d44e43c2cb 100644 --- a/src/armnn/Graph.cpp +++ b/src/armnn/Graph.cpp @@ -199,6 +199,11 @@ Status Graph::AllocateDynamicBuffers() { handleReferenceCounts[tensorHandle] = numConnections; tensorHandle->Manage(); + if (handleReferenceCounts[tensorHandle] == 0u) + { + // if nobody consumes this tensor we call Allocate() + tensorHandle->Allocate(); + } } else { -- cgit v1.2.1