diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2020-07-28 10:42:13 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2020-07-28 16:45:05 +0000 |
commit | d109a4d0fb980f2e97c05cd86451eda0b53f37ef (patch) | |
tree | 19092204016ccd60ea36637cc06a48a224508570 /src/armnnTfLiteParser/test/Conv2D.cpp | |
parent | 2f746b3f346d3efa9071fc53592652425869d6b3 (diff) | |
download | armnn-d109a4d0fb980f2e97c05cd86451eda0b53f37ef.tar.gz |
IVGCVSW-4932 Introduce ShapeInferenceMethod to TfLite Parser
* Introduced ShapeInferenceMethod::InferAndValidate to TfLiteParser
* Added unit tests
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: Iad4aadce92912e7645b1652019ec4af478b7fc32
Diffstat (limited to 'src/armnnTfLiteParser/test/Conv2D.cpp')
-rw-r--r-- | src/armnnTfLiteParser/test/Conv2D.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/armnnTfLiteParser/test/Conv2D.cpp b/src/armnnTfLiteParser/test/Conv2D.cpp index 2eae5f5a1a..8ef827ce7f 100644 --- a/src/armnnTfLiteParser/test/Conv2D.cpp +++ b/src/armnnTfLiteParser/test/Conv2D.cpp @@ -234,6 +234,32 @@ BOOST_FIXTURE_TEST_CASE( ParseConv2DWithBias, SimpleConv2DWithBiasesFixture ) }); } +struct DynamicConv2DWithBiasesFixture : Conv2DWithBiasesFixture +{ + DynamicConv2DWithBiasesFixture() + : Conv2DWithBiasesFixture("[ 1, 2, 2, 1 ]", // inputShape + "[ ]", // outputShape + "[ 1, 2, 2, 1 ]", // filterShape + "[ 2,1, 0,6 ]", // filterData + "[ 1 ]", // biasShape + "[ 10, 0, 0, 0 ]", // biasData + "1") // stride w and h + {} +}; + +BOOST_FIXTURE_TEST_CASE( ParseDynamicConv2DWithBias, DynamicConv2DWithBiasesFixture ) +{ + RunTest<4, + armnn::DataType::QAsymmU8, + armnn::DataType::QAsymmU8>(0, + { { "inputTensor", { 1, 2, 3, 4, } } }, + { { "outputTensor", { (1*2 + 2*1 + 3*0 + 4*6 + 10)/2, + (2*2 + 0*1 + 4*0 + 0*6 + 10)/2, + (3*2 + 4*1 + 0*0 + 0*6 + 10)/2, + (4*2 + 0*1 + 0*0 + 0*6 + 10)/2} } }, + true); +} + struct Conv2DShapeTestFixture : Conv2DWithBiasesFixture { static std::string GenerateInts(unsigned int n) |