6 #include <boost/test/unit_test.hpp> 8 #include "../TfLiteParser.hpp" 14 explicit SliceFixture(
const std::string & inputShape,
15 const std::string & outputShape,
16 const std::string & beginData,
17 const std::string & sizeData)
24 "builtin_code": "SLICE", 32 "shape": )" + inputShape + R"(, 35 "name": "inputTensor", 44 "quantized_dimension": 0 49 "shape": )" + outputShape + R"(, 52 "name": "outputTensor", 55 "quantized_dimension": 0 66 "name": "beginTensor", 99 mutating_variable_inputs: [ 105 "description": "TOCO Converted.", 119 struct SliceFixtureSingleDim : SliceFixture
121 SliceFixtureSingleDim() : SliceFixture(
"[ 3, 2, 3 ]",
123 "[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]",
124 "[ 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0 ]") {}
129 RunTest<3, armnn::DataType::Float32>(
131 {{
"inputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }}},
132 {{
"outputTensor", { 3, 3, 3 }}});
134 BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
138 struct SliceFixtureD123 : SliceFixture
140 SliceFixtureD123() : SliceFixture(
"[ 3, 2, 3 ]",
142 "[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]",
143 "[ 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0 ]") {}
148 RunTest<3, armnn::DataType::Float32>(
150 {{
"inputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }}},
151 {{
"outputTensor", { 3, 3, 3, 4, 4, 4 }}});
153 BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
157 struct SliceFixtureD213 : SliceFixture
159 SliceFixtureD213() : SliceFixture(
"[ 3, 2, 3 ]",
161 "[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]",
162 "[ 2, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0 ]") {}
167 RunTest<3, armnn::DataType::Float32>(
169 {{
"inputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 }}},
170 {{
"outputTensor", { 3, 3, 3, 5, 5, 5 }}});
172 BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(SliceSingleDim, SliceFixtureSingleDim)
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)