Add gtest to test neg op for int datatype (#3930)
authorShubham Gupta/SNAP /SRI-Bangalore/Engineer/삼성전자 <shub98.gupta@samsung.com>
Wed, 12 Dec 2018 01:13:43 +0000 (06:43 +0530)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 12 Dec 2018 01:13:43 +0000 (10:13 +0900)
This patch will add gtest to test neg for int datatype

Signed-off-by: shubham <shub98.gupta@samsung.com>
runtimes/tests/neural_networks_test/specs/Ex/neg_ex_3D_int.mod.py [new file with mode: 0644]
runtimes/tests/neural_networks_test/specs/Ex/neg_ex_4D_int.mod.py [new file with mode: 0644]

diff --git a/runtimes/tests/neural_networks_test/specs/Ex/neg_ex_3D_int.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/neg_ex_3D_int.mod.py
new file mode 100644 (file)
index 0000000..56dbec1
--- /dev/null
@@ -0,0 +1,25 @@
+# model
+model = Model()
+i1 = Input("op1", "TENSOR_INT32", "{2,3,4}")
+i2 = Output("op2", "TENSOR_INT32", "{2,3,4}")
+model = model.Operation("NEG_EX", i1).To(i2)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+          [3, 4, 5, 6,
+           7, 8, 9, 1,
+           2, 18, 19, 11,
+          40, 42, 4, 12,
+          22, 32, 62, 52,
+          92, 59, 69, 312]}
+
+output0 = {i2: # output 0
+          [-3, -4, -5, -6,
+          -7, -8, -9, -1,
+          -2, -18, -19, -11,
+          -40, -42, -4, -12,
+         -22, -32, -62, -52,
+         -92, -59, -69, -312]}
+
+# Instantiate an example
+Example((input0, output0))
diff --git a/runtimes/tests/neural_networks_test/specs/Ex/neg_ex_4D_int.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/neg_ex_4D_int.mod.py
new file mode 100644 (file)
index 0000000..ac90eb3
--- /dev/null
@@ -0,0 +1,25 @@
+# model
+model = Model()
+i1 = Input("op1", "TENSOR_INT32", "{2,3,2,2}")
+i2 = Output("op2", "TENSOR_INT32", "{2,3,2,2}")
+model = model.Operation("NEG_EX", i1).To(i2)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+          [3, 4, 5, 6,
+          -7, 8,-9, 1,
+           2, 18, 19, 11,
+          -40, 42, 4, 12,
+          22, -32, 62, 52,
+          92, 59, 69, -312]}
+
+output0 = {i2: # output 0
+          [-3, -4, -5, -6,
+           7, -8, 9, -1,
+           -2, -18, -19, -11,
+           40, -42, -4, -12,
+          -22, 32, -62, -52,
+          -92, -59, -69, 312]}
+
+# Instantiate an example
+Example((input0, output0))