aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfParser/test/TestMultiInputsOutputs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnTfParser/test/TestMultiInputsOutputs.cpp')
-rw-r--r--src/armnnTfParser/test/TestMultiInputsOutputs.cpp92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/armnnTfParser/test/TestMultiInputsOutputs.cpp b/src/armnnTfParser/test/TestMultiInputsOutputs.cpp
new file mode 100644
index 0000000000..5eea616ec8
--- /dev/null
+++ b/src/armnnTfParser/test/TestMultiInputsOutputs.cpp
@@ -0,0 +1,92 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// See LICENSE file in the project root for full license information.
+//
+
+#include <boost/test/unit_test.hpp>
+#include "armnnTfParser/ITfParser.hpp"
+#include "ParserPrototxtFixture.hpp"
+
+BOOST_AUTO_TEST_SUITE(TensorflowParser)
+
+struct MultiInputsOutputsFixture : public ParserPrototxtFixture<armnnTfParser::ITfParser>
+{
+ MultiInputsOutputsFixture()
+ {
+ // input1 = tf.placeholder(tf.float32, shape=[], name = "input1")
+ // input2 = tf.placeholder(tf.float32, shape = [], name = "input2")
+ // add1 = tf.add(input1, input2, name = "add1")
+ // add2 = tf.add(input1, input2, name = "add2")
+ m_Prototext = R"(
+node {
+ name: "input1"
+ op: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+}
+node {
+ name: "input2"
+ op: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+}
+node {
+ name: "add1"
+ op: "Add"
+ input: "input1"
+ input: "input2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}
+node {
+ name: "add2"
+ op: "Add"
+ input: "input1"
+ input: "input2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+}
+ )";
+ Setup({ { "input1", { 1 } },
+ { "input2", { 1 } } },
+ { "add1", "add2" });
+ }
+};
+
+BOOST_FIXTURE_TEST_CASE(MultiInputsOutputs, MultiInputsOutputsFixture)
+{
+ RunTest<1>({ { "input1", {12.0f} }, { "input2", { 13.0f } } },
+ { { "add1", { 25.0f } }, { "add2", { 25.0f } } });
+}
+
+BOOST_AUTO_TEST_SUITE_END()