aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2019-07-16 11:48:51 +0100
committerManuel Bottini <manuel.bottini@arm.com>2019-07-16 16:34:59 +0000
commit2ea3761416aab259d9d84620dba2e011bcb5d880 (patch)
tree61dc530fb18cf83ee45286837326d6be0196fcfa /src
parentba27e4467dfc04e23ce9483330be062e9aaebdc5 (diff)
downloadComputeLibrary-2ea3761416aab259d9d84620dba2e011bcb5d880.tar.gz
COMPMID-2336: Fix InPlaceMutator condition and add SaveNumpyAccessor
Change-Id: I223a688cfc19465f8581f691b32891cefd375907 Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com> Reviewed-on: https://review.mlplatform.org/c/1555 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Marquez <pablo.tello@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/graph/mutators/InPlaceOperationMutator.cpp10
1 files changed, 5 insertions, 5 deletions
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");
- }
}
}
}