11 #include <boost/test/unit_test.hpp> 17 void dimsHelper(
const std::vector<int>& dims, std::string& text){
18 for(
unsigned 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,
59 dimsHelper(input0Dims, m_Prototext); 82 dimsHelper(input1Dims, m_Prototext); 87 octalHelper(input1Content, m_Prototext); 122 Setup({ { "input0", inputShape0 },
123 {
"input1", inputShape1 } },
130 struct GatherFixture1DParams1DIndices :
public GatherFixture
132 GatherFixture1DParams1DIndices() : GatherFixture(
141 struct GatherFixture1DParamsMultiDimIndices :
public GatherFixture
143 GatherFixture1DParamsMultiDimIndices() : GatherFixture(
152 struct GatherFixtureMultiDimParamMultiDimIndices :
public GatherFixture
154 GatherFixtureMultiDimParamMultiDimIndices() : GatherFixture(
165 RunTest<4>({ {
"input0", { 1, 2, 3, 4 } } },
167 { {
"output", { 1, 3, 2, 4 } } });
172 RunTest<4>({ {
"input0", { 1, 2, 3, 4 } } },
174 { {
"output", { 1, 2, 2, 4 } } });
179 RunTest<4>({ {
"input0", { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } } },
181 { {
"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(ParseGather, SimpleGatherFixture)