From 2b4d88e34ac1f965417fd236fd4786f26bae2042 Mon Sep 17 00:00:00 2001 From: kevmay01 Date: Thu, 24 Jan 2019 14:05:09 +0000 Subject: IVGCVSW-2503 Refactor RefElementwiseWorkload around Equal and Greater * Remove Equal and Greater from RefElementwiseWorkload * Create RefComparisonWorkload and add Equal and Greater * Update ElementwiseFunction for different input/output types * Update TfParser to create Equal/Greater with Boolean output * Update relevant tests to check for Boolean comparison Change-Id: I299b7f2121769c960ac0c6139764a5f3c89c9c32 --- src/armnn/test/TensorHelpers.hpp | 21 ++++++++++++++++++--- src/armnn/test/UnitTests.hpp | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'src/armnn/test') diff --git a/src/armnn/test/TensorHelpers.hpp b/src/armnn/test/TensorHelpers.hpp index 06818d3918..fcaa0772a0 100644 --- a/src/armnn/test/TensorHelpers.hpp +++ b/src/armnn/test/TensorHelpers.hpp @@ -67,11 +67,16 @@ bool SelectiveCompare(T a, T b) return SelectiveComparer()>::Compare(a, b); }; - +template +bool SelectiveCompareBoolean(T a, T b) +{ + return (((a == 0) && (b == 0)) || ((a != 0) && (b != 0))); +}; template boost::test_tools::predicate_result CompareTensors(const boost::multi_array& a, - const boost::multi_array& b) + const boost::multi_array& b, + bool compareBoolean = false) { // Checks they are same shape. for (unsigned int i=0; i