6 #include <boost/test/unit_test.hpp> 8 #include "../Deserializer.hpp" 17 explicit SubtractionFixture(
const std::string & inputShape1,
18 const std::string & inputShape2,
19 const std::string & outputShape,
20 const std::string & dataType)
28 layer_type: "InputLayer", 34 layerName: "inputLayer1", 38 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 43 dimensions: )" + inputShape1 + R"(, 44 dataType: )" + dataType + R"( 51 layer_type: "InputLayer", 57 layerName: "inputLayer2", 61 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 66 dimensions: )" + inputShape2 + R"(, 67 dataType: )" + dataType + R"( 74 layer_type: "SubtractionLayer", 78 layerName: "subtractionLayer", 79 layerType: "Subtraction", 82 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 86 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 91 dimensions: )" + outputShape + R"(, 92 dataType: )" + dataType + R"( 98 layer_type: "OutputLayer", 104 layerName: "outputLayer", 108 connection: {sourceLayerIndex:2, outputSlotIndex:0 }, 113 dimensions: )" + outputShape + R"(, 114 dataType: )" + dataType + R"( 125 struct SimpleSubtractionFixture : SubtractionFixture
127 SimpleSubtractionFixture() : SubtractionFixture(
"[ 1, 4 ]",
130 "QuantisedAsymm8") {}
133 struct SimpleSubtractionFixture2 : SubtractionFixture
135 SimpleSubtractionFixture2() : SubtractionFixture(
"[ 1, 4 ]",
141 struct SimpleSubtractionFixtureBroadcast : SubtractionFixture
143 SimpleSubtractionFixtureBroadcast() : SubtractionFixture(
"[ 1, 4 ]",
151 RunTest<2, armnn::DataType::QAsymmU8>(
153 {{
"inputLayer1", { 4, 5, 6, 7 }},
154 {
"inputLayer2", { 3, 2, 1, 0 }}},
155 {{
"outputLayer", { 1, 3, 5, 7 }}});
160 RunTest<2, armnn::DataType::Float32>(
162 {{
"inputLayer1", { 4, 5, 6, 7 }},
163 {
"inputLayer2", { 3, 2, 1, 0 }}},
164 {{
"outputLayer", { 1, 3, 5, 7 }}});
169 RunTest<2, armnn::DataType::Float32>(
171 {{
"inputLayer1", { 4, 5, 6, 7 }},
172 {
"inputLayer2", { 2 }}},
173 {{
"outputLayer", { 2, 3, 4, 5 }}});
BOOST_FIXTURE_TEST_CASE(SubtractionQuantisedAsymm8, SimpleSubtractionFixture)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)