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/armnnTfParser/test/Greater.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/armnnTfParser/test/Greater.cpp') diff --git a/src/armnnTfParser/test/Greater.cpp b/src/armnnTfParser/test/Greater.cpp index f11c199599..d1e793987b 100644 --- a/src/armnnTfParser/test/Greater.cpp +++ b/src/armnnTfParser/test/Greater.cpp @@ -91,9 +91,9 @@ struct GreaterFixtureTwoByTwo : public GreaterFixtureAutoSetup BOOST_FIXTURE_TEST_CASE(ParseGreaterTwoByTwo, GreaterFixtureTwoByTwo) { - RunTest<2>({ { "input0", { 1.0f, 2.0f, 3.0f, 4.0f} }, - { "input1", { 1.0f, 5.0f, 2.0f, 2.0f} } }, - { { "output", { 0.0f, 0.0f, 1.0f, 1.0f} } }); + RunComparisonTest<2>({ { "input0", { 1.0f, 2.0f, 3.0f, 4.0f} }, + { "input1", { 1.0f, 5.0f, 2.0f, 2.0f} } }, + { { "output", { 0, 0, 1, 1} } }); } struct GreaterBroadcast1DAnd4D : public GreaterFixtureAutoSetup @@ -103,9 +103,9 @@ struct GreaterBroadcast1DAnd4D : public GreaterFixtureAutoSetup BOOST_FIXTURE_TEST_CASE(ParseGreaterBroadcast1DToTwoByTwo, GreaterBroadcast1DAnd4D) { - RunTest<4>({ { "input0", { 2.0f } }, - { "input1", { 1.0f, 2.0f, 3.0f, 2.0f } } }, - { { "output", { 1.0f, 0.0f, 0.0f, 0.0f } } }); + RunComparisonTest<4>({ { "input0", { 2.0f } }, + { "input1", { 1.0f, 2.0f, 3.0f, 2.0f } } }, + { { "output", { 1, 0, 0, 0 } } }); } struct GreaterBroadcast4DAnd1D : public GreaterFixtureAutoSetup @@ -115,9 +115,9 @@ struct GreaterBroadcast4DAnd1D : public GreaterFixtureAutoSetup BOOST_FIXTURE_TEST_CASE(ParseGreaterBroadcast4DAnd1D, GreaterBroadcast4DAnd1D) { - RunTest<4>({ { "input0", { 1.0f, 2.0f, 3.0f, 2.0f } }, - { "input1", { 3.0f } } }, - { { "output", { 0.0f, 0.0f, 0.0f, 0.0f } } }); + RunComparisonTest<4>({ { "input0", { 1.0f, 2.0f, 3.0f, 2.0f } }, + { "input1", { 3.0f } } }, + { { "output", { 0, 0, 0, 0 } } }); } struct GreaterMultiDimBroadcast : public GreaterFixtureAutoSetup @@ -127,13 +127,13 @@ struct GreaterMultiDimBroadcast : public GreaterFixtureAutoSetup BOOST_FIXTURE_TEST_CASE(ParseGreaterMultiDimBroadcast, GreaterMultiDimBroadcast) { - RunTest<4>({ { "input0", { 1.0f, 2.0f } }, - { "input1", { 1.0f, 2.0f, 3.0f, - 3.0f, 2.0f, 2.0f } } }, - { { "output", { 0.0f, 0.0f, 0.0f, - 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f } } }); + RunComparisonTest<4>({ { "input0", { 1.0f, 2.0f } }, + { "input1", { 1.0f, 2.0f, 3.0f, + 3.0f, 2.0f, 2.0f } } }, + { { "output", { 0, 0, 0, + 1, 0, 0, + 0, 0, 0, + 0, 0, 0 } } }); } BOOST_AUTO_TEST_SUITE_END() -- cgit v1.2.1