2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
5 #include <boost/test/unit_test.hpp>
6 #include "armnnTfParser/ITfParser.hpp"
7 #include "ParserPrototxtFixture.hpp"
9 BOOST_AUTO_TEST_SUITE(TensorflowParser)
11 struct PassThruFixture : public armnnUtils::ParserPrototxtFixture<armnnTfParser::ITfParser>
15 m_Prototext = "node {\n"
16 " name: \"Placeholder\"\n"
17 " op: \"Placeholder\"\n"
32 SetupSingleInputSingleOutput({ 1, 7 }, "Placeholder", "Placeholder");
36 BOOST_FIXTURE_TEST_CASE(ValidateOutput, PassThruFixture)
38 BOOST_TEST(m_Parser->GetNetworkOutputBindingInfo("Placeholder").second.GetNumDimensions() == 2);
39 BOOST_TEST(m_Parser->GetNetworkOutputBindingInfo("Placeholder").second.GetShape()[0] == 1);
40 BOOST_TEST(m_Parser->GetNetworkOutputBindingInfo("Placeholder").second.GetShape()[1] == 7);
43 BOOST_FIXTURE_TEST_CASE(RunGraph, PassThruFixture)
45 armnn::TensorInfo inputTensorInfo = m_Parser->GetNetworkInputBindingInfo("Placeholder").second;
46 auto input = MakeRandomTensor<float, 2>(inputTensorInfo, 378346);
47 std::vector<float> inputVec;
48 inputVec.assign(input.data(), input.data() + input.num_elements());
49 RunTest<2>(inputVec, inputVec); // The passthru network should output the same as the input.
52 BOOST_AUTO_TEST_SUITE_END()