From d109a4d0fb980f2e97c05cd86451eda0b53f37ef Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Tue, 28 Jul 2020 10:42:13 +0100 Subject: IVGCVSW-4932 Introduce ShapeInferenceMethod to TfLite Parser * Introduced ShapeInferenceMethod::InferAndValidate to TfLiteParser * Added unit tests Signed-off-by: Sadik Armagan Change-Id: Iad4aadce92912e7645b1652019ec4af478b7fc32 --- src/armnn/test/TensorHelpers.hpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'src/armnn/test') diff --git a/src/armnn/test/TensorHelpers.hpp b/src/armnn/test/TensorHelpers.hpp index 286d9f396e..45360350dd 100644 --- a/src/armnn/test/TensorHelpers.hpp +++ b/src/armnn/test/TensorHelpers.hpp @@ -74,20 +74,26 @@ bool SelectiveCompareBoolean(T a, T b) template boost::test_tools::predicate_result CompareTensors(const boost::multi_array& a, const boost::multi_array& b, - bool compareBoolean = false) + bool compareBoolean = false, + bool isDynamic = false) { - // Checks they are same shape. - for (unsigned int i=0; i MakeTensor(const armnn::TensorInfo& tensorInfo) // Creates a boost::multi_array with the shape defined by the given TensorInfo and contents defined by the given vector. template -boost::multi_array MakeTensor(const armnn::TensorInfo& tensorInfo, const std::vector& flat) +boost::multi_array MakeTensor( + const armnn::TensorInfo& tensorInfo, const std::vector& flat, bool isDynamic = false) { - ARMNN_ASSERT_MSG(flat.size() == tensorInfo.GetNumElements(), "Wrong number of components supplied to tensor"); + if (!isDynamic) + { + ARMNN_ASSERT_MSG(flat.size() == tensorInfo.GetNumElements(), "Wrong number of components supplied to tensor"); + } std::array shape; -- cgit v1.2.1