blob: 4eb6b12467e5f67124498d6c3029303e177373bd [file] [log] [blame]
surmeh01bceff2f2018-03-29 16:29:27 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5
6#include <boost/test/unit_test.hpp>
7#include "armnnTfParser/ITfParser.hpp"
8#include "ParserPrototxtFixture.hpp"
9
10BOOST_AUTO_TEST_SUITE(TensorflowParser)
11
12
13struct ReshapeFixture : public ParserPrototxtFixture<armnnTfParser::ITfParser>
14{
15 ReshapeFixture()
16 {
17 m_Prototext = "node { \n"
18 " name: \"graphInput\" \n"
19 " op: \"Placeholder\" \n"
20 " attr { \n"
21 " key: \"dtype\" \n"
22 " value { \n"
23 " type: DT_FLOAT \n"
24 " } \n"
25 " } \n"
26 " attr { \n"
27 " key: \"shape\" \n"
28 " value { \n"
29 " shape { \n"
30 " } \n"
31 " } \n"
32 " } \n"
33 " } \n"
34 "node { \n"
35 " name: \"Reshape/shape\" \n"
36 " op: \"Const\" \n"
37 " attr { \n"
38 " key: \"dtype\" \n"
39 " value { \n"
40 " type: DT_INT32 \n"
41 " } \n"
42 " } \n"
43 " attr { \n"
44 " key: \"value\" \n"
45 " value { \n"
46 " tensor { \n"
47 " dtype: DT_INT32 \n"
48 " tensor_shape { \n"
49 " dim { \n"
50 " size: 2 \n"
51 " } \n"
52 " } \n"
53 " tensor_content: \"\\002\\000\\000\\000\\002\\000\\000\\000\" \n"
54 " } \n"
55 " } \n"
56 " } \n"
57 "} \n"
58 "node { \n"
59 " name: \"Reshape\" \n"
60 " op: \"Reshape\" \n"
61 " input: \"graphInput\" \n"
62 " input: \"Reshape/shape\" \n"
63 " attr { \n"
64 " key: \"T\" \n"
65 " value { \n"
66 " type: DT_FLOAT \n"
67 " } \n"
68 " } \n"
69 " attr { \n"
70 " key: \"Tshape\" \n"
71 " value { \n"
72 " type: DT_INT32 \n"
73 " } \n"
74 " } \n"
75 "} \n";
76
77 SetupSingleInputSingleOutput({1, 4}, "graphInput", "Reshape");
78 }
79};
80
81BOOST_FIXTURE_TEST_CASE(ParseReshape, ReshapeFixture)
82{
83 RunTest<2>({ 0.0f, 1.0f, 2.0f, 3.0f }, { 0.0f, 1.0f, 2.0f, 3.0f });
84}
85
86BOOST_AUTO_TEST_SUITE_END()