From: Shubham Gupta/SNAP /SRI-Bangalore/Engineer/삼성전자 Date: Mon, 10 Dec 2018 01:26:14 +0000 (+0530) Subject: Add gtest to test Argmax op for tensors of QASYMM8 dataype (#3802) X-Git-Tag: 0.3~156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8528a073a330c19903522ea32c437bd1f0047714;p=platform%2Fcore%2Fml%2Fnnfw.git Add gtest to test Argmax op for tensors of QASYMM8 dataype (#3802) This patch will add gtest for Argmax to test for tensors of QASYMM8 dataype Signed-off-by: shubham --- 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 index 0000000..fd3c523 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/argmax_ex_quant8.mod.py @@ -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 index 0000000..c7ddc0e --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/argmax_ex_quant8_neg_axis.mod.py @@ -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))