From 0ae5de9124a0094e656244ad2f807c084966fc04 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Thu, 14 Mar 2019 10:32:11 +0000 Subject: COMPMID-1995: Prepare Graph to support different input/output quantization info - Added support for different input/output qinfo in ActivationLayer and DepthwiseConv - Added support for different input/output qinfo in ConcatenateLayer introducing ConcatDescriptor - Added reshape validate - Allow OutputLayer to return a specific connection index from the input - Not run Inplace and Depth mutator when input/output quantization info are different Change-Id: I03f5e416fc43ddd284e1501887202a3145f76d8a Signed-off-by: Isabella Gottardi Reviewed-on: https://review.mlplatform.org/c/852 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas --- utils/Utils.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'utils/Utils.h') diff --git a/utils/Utils.h b/utils/Utils.h index 04ccc3e812..788ae4eeb7 100644 --- a/utils/Utils.h +++ b/utils/Utils.h @@ -782,15 +782,16 @@ void init_sgemm_output(T &dst, T &src0, T &src1, arm_compute::DataType dt) */ uint64_t get_mem_free_from_meminfo(); -/** Compare to tensor +/** Compare two tensors * - * @param[in] tensor1 First tensor to be compared. - * @param[in] tensor2 Second tensor to be compared. + * @param[in] tensor1 First tensor to be compared. + * @param[in] tensor2 Second tensor to be compared. + * @param[in] tolerance Tolerance used for the comparison. * * @return The number of mismatches */ template -int compare_tensor(ITensor &tensor1, ITensor &tensor2) +int compare_tensor(ITensor &tensor1, ITensor &tensor2, T tolerance) { ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(&tensor1, &tensor2); ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES(&tensor1, &tensor2); @@ -807,7 +808,7 @@ int compare_tensor(ITensor &tensor1, ITensor &tensor2) execute_window_loop(window, [&](const Coordinates & id) { - if(std::abs(*reinterpret_cast(itensor1.ptr()) - *reinterpret_cast(itensor2.ptr())) > 0.0001) + if(std::abs(*reinterpret_cast(itensor1.ptr()) - *reinterpret_cast(itensor2.ptr())) > tolerance) { ++num_mismatches; } -- cgit v1.2.1