5 #include <boost/test/unit_test.hpp> 9 #include <initializer_list> 15 std::string TaggedSequence(
const std::string & tag,
const std::initializer_list<T> & data)
19 for (
auto && d : data)
29 ss <<
" " << tag <<
" : " << d <<
" ";
35 std::string TaggedSequence(
const std::string & tag, T data,
unsigned int n)
38 for (
unsigned int i=0; i<n; ++i)
44 ss <<
" " << tag <<
" : " << data <<
" ";
55 ConvolutionFixture(
const std::initializer_list<unsigned int> & inputDims,
56 const std::initializer_list<float> & filterData,
57 unsigned int kernelSize,
58 unsigned int numOutput=1,
62 name: "ConvolutionTest" 67 input_param { shape: { )" + TaggedSequence("dim", inputDims) + R
"( } } 74 blobs: { )" + TaggedSequence("data", filterData) + R
"( } 75 blobs: { )" + TaggedSequence("data", 0, numOutput) + R
"( } 77 num_output: )" + std::to_string(numOutput) + R"( 79 kernel_size: )" + std::to_string(kernelSize) + R"( 81 group: )" + std::to_string(group) + R"( 89 struct SimpleConvolutionFixture :
public ConvolutionFixture
91 SimpleConvolutionFixture()
92 : ConvolutionFixture( {1, 1, 2, 2}, {1.0f, 1.0f, 1.0f, 1.0f}, 2)
99 RunTest<4>({ 1, 3, 5, 7 }, { 16 });
102 struct GroupConvolutionFixture :
public ConvolutionFixture
104 GroupConvolutionFixture()
105 : ConvolutionFixture(
108 1.0f, 1.0f, 1.0f, 1.0f,
109 2.0f, 2.0f, 2.0f, 2.0f
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(SimpleConvolution, SimpleConvolutionFixture)
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
Parses and loads the network defined by the m_Prototext string.