11 #include <boost/test/unit_test.hpp> 17 void dimsHelper(
const std::vector<int>& dims, std::string& text){
18 for(u_int i = 0; i < dims.size(); ++i) {
21 text.append(std::to_string(dims[i])); 28 void octalHelper(
const std::vector<int>& indicesContent, std::string& text){
29 for(
unsigned int i = 0; i < indicesContent.size(); ++i) {
39 const std::vector<int>& input1Content,
40 const std::vector<int>& input0Dims,
41 const std::vector<int>& input1Dims)
58 dimsHelper(input0Dims, m_Prototext); 80 dimsHelper(input1Dims, m_Prototext); 84 octalHelper(input1Content, m_Prototext); 109 Setup({ { "input0", inputShape0 },
110 {
"input1", inputShape1 } },
117 struct GatherFixture1DParams1DIndices :
public GatherFixture
119 GatherFixture1DParams1DIndices() : GatherFixture(
127 struct GatherFixture1DParamsMultiDimIndices :
public GatherFixture
129 GatherFixture1DParamsMultiDimIndices() : GatherFixture(
137 struct GatherFixtureMultiDimParamMultiDimIndices :
public GatherFixture
139 GatherFixtureMultiDimParamMultiDimIndices() : GatherFixture(
149 RunTest<4>({ {
"input0", { 1, 2, 3, 4 } } },
151 { {
"output", { 1, 3, 2, 4 } } });
156 RunTest<4>({ {
"input0", { 1, 2, 3, 4 } } },
158 { {
"output", { 1, 2, 2, 4 } } });
163 RunTest<4>({ {
"input0", { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } } },
165 { {
"output", { 3, 4, 7, 8, 1, 2, 5, 6} } });
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
std::string ConvertInt32ToOctalString(int value)
Converts an int value into the Prototxt octal representation.
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_CASE(ParseGather1DParams1DIndices, GatherFixture1DParams1DIndices)