From 2ea3761416aab259d9d84620dba2e011bcb5d880 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Tue, 16 Jul 2019 11:48:51 +0100 Subject: COMPMID-2336: Fix InPlaceMutator condition and add SaveNumpyAccessor Change-Id: I223a688cfc19465f8581f691b32891cefd375907 Signed-off-by: Isabella Gottardi Reviewed-on: https://review.mlplatform.org/c/1555 Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez Comments-Addressed: Arm Jenkins Reviewed-by: Michalis Spyrou --- src/graph/mutators/InPlaceOperationMutator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/graph/mutators/InPlaceOperationMutator.cpp b/src/graph/mutators/InPlaceOperationMutator.cpp index 1c2985dce6..07e3ecf2c7 100644 --- a/src/graph/mutators/InPlaceOperationMutator.cpp +++ b/src/graph/mutators/InPlaceOperationMutator.cpp @@ -57,7 +57,11 @@ void InPlaceOperationMutator::mutate(Graph &g) ARM_COMPUTE_ERROR_ON(current_output_tensor == nullptr || new_output_tensor == nullptr); // Prevent in-place operation if there is an accessor bound to the in-place tensor or quantization info are different - if(new_output_tensor->accessor() == nullptr || current_output_tensor->desc().quant_info == new_output_tensor->desc().quant_info) + if(new_output_tensor->accessor() != nullptr || current_output_tensor->desc().quant_info != new_output_tensor->desc().quant_info) + { + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Prevented in-place operation as there is an accessor bound to the input tensor or the quantization info are different.\n"); + } + else { ARM_COMPUTE_LOG_GRAPH_VERBOSE("Switching to in-place computation for the node with ID : " << node->id() << " and name : " << node->name() << std::endl); @@ -66,10 +70,6 @@ void InPlaceOperationMutator::mutate(Graph &g) // Update output node->set_output_tensor(new_output_tensor->id(), 0); } - else - { - ARM_COMPUTE_LOG_GRAPH_VERBOSE("Prevented in-place operation as there is an accessor bound to the input tensor\n"); - } } } } -- cgit v1.2.1