From 179cff69263242cb6e2e4e80973cbedab51299ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Shubham=20Gupta/SNAP=20/SRI-Bangalore/Engineer/=EC=82=BC?= =?utf8?q?=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 12 Dec 2018 06:43:43 +0530 Subject: [PATCH] Add gtest to test neg op for int datatype (#3930) This patch will add gtest to test neg for int datatype Signed-off-by: shubham --- .../specs/Ex/neg_ex_3D_int.mod.py | 25 ++++++++++++++++++++++ .../specs/Ex/neg_ex_4D_int.mod.py | 25 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/neg_ex_3D_int.mod.py create mode 100644 runtimes/tests/neural_networks_test/specs/Ex/neg_ex_4D_int.mod.py 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 index 0000000..56dbec1 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/neg_ex_3D_int.mod.py @@ -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 index 0000000..ac90eb3 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/neg_ex_4D_int.mod.py @@ -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)) -- 2.7.4