6 #include <boost/test/unit_test.hpp> 16 explicit SubtractionFixture(
const std::string & inputShape1,
17 const std::string & inputShape2,
18 const std::string & outputShape,
19 const std::string & dataType)
27 layer_type: "InputLayer", 33 layerName: "inputLayer1", 37 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 42 dimensions: )" + inputShape1 + R"(, 43 dataType: )" + dataType + R"( 50 layer_type: "InputLayer", 56 layerName: "inputLayer2", 60 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 65 dimensions: )" + inputShape2 + R"(, 66 dataType: )" + dataType + R"( 73 layer_type: "SubtractionLayer", 77 layerName: "subtractionLayer", 78 layerType: "Subtraction", 81 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 85 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 90 dimensions: )" + outputShape + R"(, 91 dataType: )" + dataType + R"( 97 layer_type: "OutputLayer", 103 layerName: "outputLayer", 107 connection: {sourceLayerIndex:2, outputSlotIndex:0 }, 112 dimensions: )" + outputShape + R"(, 113 dataType: )" + dataType + R"( 124 struct SimpleSubtractionFixture : SubtractionFixture
126 SimpleSubtractionFixture() : SubtractionFixture(
"[ 1, 4 ]",
129 "QuantisedAsymm8") {}
132 struct SimpleSubtractionFixture2 : SubtractionFixture
134 SimpleSubtractionFixture2() : SubtractionFixture(
"[ 1, 4 ]",
140 struct SimpleSubtractionFixtureBroadcast : SubtractionFixture
142 SimpleSubtractionFixtureBroadcast() : SubtractionFixture(
"[ 1, 4 ]",
150 RunTest<2, armnn::DataType::QAsymmU8>(
152 {{
"inputLayer1", { 4, 5, 6, 7 }},
153 {
"inputLayer2", { 3, 2, 1, 0 }}},
154 {{
"outputLayer", { 1, 3, 5, 7 }}});
159 RunTest<2, armnn::DataType::Float32>(
161 {{
"inputLayer1", { 4, 5, 6, 7 }},
162 {
"inputLayer2", { 3, 2, 1, 0 }}},
163 {{
"outputLayer", { 1, 3, 5, 7 }}});
168 RunTest<2, armnn::DataType::Float32>(
170 {{
"inputLayer1", { 4, 5, 6, 7 }},
171 {
"inputLayer2", { 2 }}},
172 {{
"outputLayer", { 2, 3, 4, 5 }}});
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_CASE(SubtractionQuantisedAsymm8, SimpleSubtractionFixture)