6 #include <boost/test/unit_test.hpp> 8 #include "../TfLiteParser.hpp" 17 explicit FullyConnectedFixture(
const std::string& inputShape,
18 const std::string& outputShape,
19 const std::string& filterShape,
20 const std::string& filterData,
21 const std::string biasShape =
"",
22 const std::string biasData =
"")
24 std::string inputTensors =
"[ 0, 2 ]";
25 std::string biasTensor =
"";
26 std::string biasBuffer =
"";
27 if (biasShape.size() > 0 && biasData.size() > 0)
29 inputTensors =
"[ 0, 2, 3 ]";
32 "shape": )" + biasShape + R"( , 44 { "data": )" + biasData + R"(, }, )"; 49 "operator_codes": [ { "builtin_code": "FULLY_CONNECTED" } ], 53 "shape": )" + inputShape + R"(, 56 "name": "inputTensor", 65 "shape": )" + outputShape + R"(, 68 "name": "outputTensor", 77 "shape": )" + filterShape + R"(, 80 "name": "filterTensor", 87 }, )" + biasTensor + R"( 94 "inputs": )" + inputTensors + R"(, 96 "builtin_options_type": "FullyConnectedOptions", 98 "fused_activation_function": "NONE" 100 "custom_options_format": "FLEXBUFFERS" 107 { "data": )" + filterData + R"(, }, )" 116 struct FullyConnectedWithNoBiasFixture : FullyConnectedFixture
118 FullyConnectedWithNoBiasFixture()
119 : FullyConnectedFixture(
"[ 1, 4, 1, 1 ]",
128 RunTest<2, armnn::DataType::QAsymmU8>(
134 struct FullyConnectedWithBiasFixture : FullyConnectedFixture
136 FullyConnectedWithBiasFixture()
137 : FullyConnectedFixture(
"[ 1, 4, 1, 1 ]",
148 RunTest<2, armnn::DataType::QAsymmU8>(
154 struct FullyConnectedWithBiasMultipleOutputsFixture : FullyConnectedFixture
156 FullyConnectedWithBiasMultipleOutputsFixture()
157 : FullyConnectedFixture(
"[ 1, 4, 2, 1 ]",
168 RunTest<2, armnn::DataType::QAsymmU8>(
170 { 1, 2, 3, 4, 10, 20, 30, 40 },
171 { (40+10)/2, (400+10)/2 });
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_CASE(MatMul, MatMulFixture)
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)