Add gtest to test Argmax op for tensors of QASYMM8 dataype (#3802)
authorShubham Gupta/SNAP /SRI-Bangalore/Engineer/삼성전자 <shub98.gupta@samsung.com>
Mon, 10 Dec 2018 01:26:14 +0000 (06:56 +0530)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 10 Dec 2018 01:26:14 +0000 (10:26 +0900)
This patch will add gtest for Argmax to test for tensors of
QASYMM8 dataype

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

diff --git a/runtimes/tests/neural_networks_test/specs/Ex/argmax_ex_quant8.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/argmax_ex_quant8.mod.py
new file mode 100644 (file)
index 0000000..fd3c523
--- /dev/null
@@ -0,0 +1,18 @@
+model = Model()
+i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{1, 2, 2, 1}, 0.5f, 2")
+axis = Parameter("axis", "TENSOR_INT32", "{1}", [1])
+output = Output("output", "TENSOR_INT32", "{1, 1, 2, 1}")
+
+model = model.Operation("ARGMAX_EX", i1, axis).To(output)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+          [1, 4,
+           2, 3]}
+
+output0 = {output: # output 0
+          [1,
+           0]}
+
+# Instantiate an example
+Example((input0, output0))
diff --git a/runtimes/tests/neural_networks_test/specs/Ex/argmax_ex_quant8_neg_axis.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/argmax_ex_quant8_neg_axis.mod.py
new file mode 100644 (file)
index 0000000..c7ddc0e
--- /dev/null
@@ -0,0 +1,17 @@
+model = Model()
+i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{1, 2, 4, 1}, 0.5f, 5")
+axis = Parameter("axis", "TENSOR_INT32", "{1}", [-3])
+output = Output("output", "TENSOR_INT32", "{1, 1, 4, 1}")
+
+model = model.Operation("ARGMAX_EX", i1, axis).To(output)
+
+# Example 1. Input in operand 0,
+input0 = {i1: # input 0
+          [1, 2, 7, 8,
+           1, 9, 7, 3]}
+
+output0 = {output: # output 0
+          [0, 1, 0, 0]}
+
+# Instantiate an example
+Example((input0, output0))