6 #include <boost/test/unit_test.hpp> 8 #include "../TfLiteParser.hpp" 14 explicit TransposeConvFixture(
const std::string& inputShape,
15 const std::string& outputShape,
16 const std::string& filterShape,
17 const std::string& filterData,
18 const std::string& strideX,
19 const std::string& strideY,
20 const std::string& dataType)
25 "operator_codes": [ { "builtin_code": "TRANSPOSE_CONV" } ], 32 "name": "outputShapeTensor", 41 "shape": )" + filterShape + R"(, 42 "type": ")" + dataType + R"(", 44 "name": "filterTensor", 53 "shape": )" + inputShape + R"(, 54 "type": ")" + dataType + R"(", 56 "name": "inputTensor", 65 "shape": )" + outputShape + R"(, 66 "type": ")" + dataType + R"(", 68 "name": "outputTensor", 82 "inputs": [ 0, 1, 2 ], 84 "builtin_options_type": "TransposeConvOptions", 87 "stride_w": )" + strideX + R"(, 88 "stride_h": )" + strideY + R"( 90 "custom_options_format": "FLEXBUFFERS" 95 { "data": )" + outputShape + R"( }, 96 { "data": )" + filterData + R"( }, 106 struct SimpleTransposeConvFixture : TransposeConvFixture
108 SimpleTransposeConvFixture()
109 : TransposeConvFixture(
"[ 1, 2, 2, 1 ]",
121 RunTest<4, armnn::DataType::QAsymmU8>(
136 explicit TransposeConvFixtureWithBias(
const std::string& inputShape,
137 const std::string& outputShape,
138 const std::string& filterShape,
139 const std::string& filterData,
140 const std::string& strideX,
141 const std::string& strideY,
142 const std::string& dataType,
143 const std::string& biasShape,
144 const std::string& biasData)
149 "operator_codes": [ { "builtin_code": "TRANSPOSE_CONV" } ], 156 "name": "outputShapeTensor", 165 "shape": )" + filterShape + R"(, 166 "type": ")" + dataType + R"(", 168 "name": "filterTensor", 177 "shape": )" + inputShape + R"(, 178 "type": ")" + dataType + R"(", 180 "name": "inputTensor", 189 "shape": )" + biasShape + R"( , 192 "name": "biasTensor", 201 "shape": )" + outputShape + R"(, 202 "type": ")" + dataType + R"(", 204 "name": "outputTensor", 218 "inputs": [ 0, 1, 2, 3], 220 "builtin_options_type": "TransposeConvOptions", 223 "stride_w": )" + strideX + R"(, 224 "stride_h": )" + strideY + R"( 226 "custom_options_format": "FLEXBUFFERS" 231 { "data": )" + outputShape + R"( }, 232 { "data": )" + filterData + R"( }, 234 { "data": )" + biasData + R"( }, 239 SetupSingleInputSingleOutput("inputTensor",
"outputTensor");
243 struct SimpleTransposeConvFixtureWithBias : TransposeConvFixtureWithBias
245 SimpleTransposeConvFixtureWithBias()
246 : TransposeConvFixtureWithBias(
"[ 1, 2, 2, 1 ]",
260 RunTest<4, armnn::DataType::QAsymmU8>(
276 explicit TransposeConvPerChannelFixture()
283 "builtin_code": "TRANSPOSE_CONV", 313 "details_type": "NONE", 314 "quantized_dimension": 0 324 "name": "model/conv2d_transpose/stack", 326 "details_type": "NONE", 327 "quantized_dimension": 0 340 "name": "model/conv2d_transpose/conv2d_transpose", 382 "details_type": "NONE", 383 "quantized_dimension": 0 410 "details_type": "NONE", 411 "quantized_dimension": 0 433 "builtin_options_type": "TransposeConvOptions", 439 "custom_options_format": "FLEXBUFFERS" 445 "description": "MLIR Converted.", 564 "name": "min_runtime_version", 570 SetupSingleInputSingleOutput("input",
"Identity");
576 RunTest<4, armnn::DataType::QAsymmS8>(
579 -11, 40,-26, 11,-28, 8, 0, -8,
580 -10, 34, 47, 0,-33,-14, 28, 35,
581 6,-28,-26, 8, 13, 33,-31,-41,
582 31,-20,-31,-16, 8,-18,-44, 0
585 -8,-17, -8, -9,-16, 1, 2,-11,
586 3,-16,-19,-12,-11, -6, -3, -6,
587 -5, -8,-16,-12,-11, -3, -7,-13,
588 -4, 1, -9,-10, -5,-12, -5, -8,
589 2,-25, -5, -6,-20, -7, 2,-21,
590 1, 4, 5,-13,-10,-12, 3, 4,
591 -10,-17,-17, -6, -7, 12,-22,-17,
592 -17, 0, -5,-14,-21,-12, 17,-13,
593 3, -6, -3, -3, -2,-16,-11,-12,
594 -15,-14, -1, -2,-35, 5,-18, 0,
595 -6, 8, 5,-12, 12, 7, -6, -3,
596 11,-28,-28, -3,-18,-29, -5,-13,
597 -12, 11, -2, -5, 6, -9, -6, 7,
598 -9,-11,-14, -2, 12, 5,-21,-23,
599 -4, -4, -6, -6,-21,-25, 0,-18,
600 -26, 10, -7,-13, 3, 39,-39, -4
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
BOOST_FIXTURE_TEST_CASE(ParseSimpleTransposeConv, SimpleTransposeConvFixture)