diff options
Diffstat (limited to 'tests/nnapi/specs/Ex')
88 files changed, 341 insertions, 992 deletions
diff --git a/tests/nnapi/specs/Ex/argmax_ex_float_1.mod.py b/tests/nnapi/specs/Ex/argmax_ex_float_1.mod.py index e2255e004..dc29fb358 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_float_1.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_float_1.mod.py @@ -1,7 +1,7 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [1]) -output = Output("output", "TENSOR_INT32", "{1, 1, 2, 1}") +output = Output("output", "TENSOR_INT32", "{1, 2, 1}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/argmax_ex_float_2.mod.py b/tests/nnapi/specs/Ex/argmax_ex_float_2.mod.py index 6f06bfd0b..8b6ed565f 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_float_2.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_float_2.mod.py @@ -1,7 +1,7 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 2}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [3]) -output = Output("output", "TENSOR_INT32", "{1, 2, 2, 1}") +output = Output("output", "TENSOR_INT32", "{1, 2, 2}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/argmax_ex_int32.mod.py b/tests/nnapi/specs/Ex/argmax_ex_int32.mod.py index f7f98afe2..b5d01dd85 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_int32.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_int32.mod.py @@ -1,7 +1,7 @@ model = Model() i1 = Input("input", "TENSOR_INT32", "{1, 2, 2, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [1]) -output = Output("output", "TENSOR_INT32", "{1, 1, 2, 1}") +output = Output("output", "TENSOR_INT32", "{1, 2, 1}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/argmax_ex_neg_axis_float.mod.py b/tests/nnapi/specs/Ex/argmax_ex_neg_axis_float.mod.py index b29cf1eb6..977cac061 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_neg_axis_float.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_neg_axis_float.mod.py @@ -1,7 +1,7 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 4, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [-3]) -output = Output("output", "TENSOR_INT32", "{1, 1, 4, 1}") +output = Output("output", "TENSOR_INT32", "{1, 4, 1}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/argmax_ex_neg_axis_int32.mod.py b/tests/nnapi/specs/Ex/argmax_ex_neg_axis_int32.mod.py index ddc27b35a..9f448e08d 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_neg_axis_int32.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_neg_axis_int32.mod.py @@ -1,7 +1,7 @@ model = Model() i1 = Input("input", "TENSOR_INT32", "{1, 2, 4, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [-3]) -output = Output("output", "TENSOR_INT32", "{1, 1, 4, 1}") +output = Output("output", "TENSOR_INT32", "{1, 4, 1}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/argmax_ex_quant8.mod.py b/tests/nnapi/specs/Ex/argmax_ex_quant8.mod.py index fd3c5230b..c3131ef91 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_quant8.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_quant8.mod.py @@ -1,7 +1,7 @@ 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}") +output = Output("output", "TENSOR_INT32", "{1, 2, 1}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/argmax_ex_quant8_neg_axis.mod.py b/tests/nnapi/specs/Ex/argmax_ex_quant8_neg_axis.mod.py index c7ddc0e5d..9146d8f14 100644 --- a/tests/nnapi/specs/Ex/argmax_ex_quant8_neg_axis.mod.py +++ b/tests/nnapi/specs/Ex/argmax_ex_quant8_neg_axis.mod.py @@ -1,7 +1,7 @@ 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}") +output = Output("output", "TENSOR_INT32", "{1, 4, 1}") model = model.Operation("ARGMAX_EX", i1, axis).To(output) diff --git a/tests/nnapi/specs/Ex/cast_ex_float32_to_int32.mod.py b/tests/nnapi/specs/Ex/cast_ex_float32_to_int32.mod.py deleted file mode 100644 index 8f94fb8ae..000000000 --- a/tests/nnapi/specs/Ex/cast_ex_float32_to_int32.mod.py +++ /dev/null @@ -1,15 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 3}") -i2 = Output("op2", "TENSOR_INT32", "{2, 3}") -model = model.Operation("CAST_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [100.0, 20.0, 3.0, 0.4, 0.999, 1.1]} - -output0 = {i2: # output 0 - [100, 20, 3, 0, 0, 1]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/cast_ex_int32_to_float32.mod.py b/tests/nnapi/specs/Ex/cast_ex_int32_to_float32.mod.py deleted file mode 100644 index 4a85dc9c5..000000000 --- a/tests/nnapi/specs/Ex/cast_ex_int32_to_float32.mod.py +++ /dev/null @@ -1,15 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_INT32", "{2, 3}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2, 3}") -model = model.Operation("CAST_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [100, 200, 300, 400, 500, 600]} - -output0 = {i2: # output 0 - [100.0, 200.0, 300.0, 400.0, 500.0, 600.0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/exp_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/exp_ex_1D_float.mod.py deleted file mode 100644 index 1979b0aec..000000000 --- a/tests/nnapi/specs/Ex/exp_ex_1D_float.mod.py +++ /dev/null @@ -1,15 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of 4 float32s -i2 = Output("op2", "TENSOR_FLOAT32", "{4}") # a vector of 4 float32s -model = model.Operation("EXP_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.0, 4.0, 5.0, 6.0]} - -output0 = {i2: # output 0 - [20.085537, 54.59815, 148.41316, 403.4288]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/exp_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/exp_ex_2D_float.mod.py deleted file mode 100644 index a79ca9a8a..000000000 --- a/tests/nnapi/specs/Ex/exp_ex_2D_float.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}") # a vector of 12 float32s -i2 = Output("op2", "TENSOR_FLOAT32", "{3,4}") # a vector of 12 float32s -model = model.Operation("EXP_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]} - -output0 = {i2: # output 0 - [2.2724796e+01, 6.1772419e+01, 1.6791484e+02, 4.5643985e+02, - 1.2407322e+03, 3.3726597e+03, 9.1678398e+03, 3.0754671e+00, - 8.3599854e+00, 7.4287776e+07, 2.0193510e+08, 6.7741680e+04]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/exp_ex_3D_float.mod.py b/tests/nnapi/specs/Ex/exp_ex_3D_float.mod.py deleted file mode 100644 index c9e30e099..000000000 --- a/tests/nnapi/specs/Ex/exp_ex_3D_float.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2,3,2}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2,3,2}") -model = model.Operation("EXP_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]} - -output0 = {i2: # output 0 - [2.2724796e+01, 6.1772419e+01, 1.6791484e+02, 4.5643985e+02, - 1.2407322e+03, 3.3726597e+03, 9.1678398e+03, 3.0754671e+00, - 8.3599854e+00, 7.4287776e+07, 2.0193510e+08, 6.7741680e+04]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/exp_ex_4D_float.mod.py b/tests/nnapi/specs/Ex/exp_ex_4D_float.mod.py deleted file mode 100644 index d7b777d95..000000000 --- a/tests/nnapi/specs/Ex/exp_ex_4D_float.mod.py +++ /dev/null @@ -1,31 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2,3,2,3}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2,3,2,3}") -model = model.Operation("EXP_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]} - -output0 = {i2: # output 0 - [2.2724796e+01, 6.1772419e+01, 1.6791484e+02, 4.5643985e+02, - 1.2407322e+03, 3.3726597e+03, 9.1678398e+03, 3.0754671e+00, - 8.3599854e+00, 7.4287776e+07, 2.0193510e+08, 6.7741680e+04, - 1.2407322e+03, 3.3726597e+03, 9.1678398e+03, 3.0754671e+00, - 2.2724796e+01, 6.1772419e+01, 1.6791484e+02, 4.5643985e+02, - 2.2724796e+01, 6.1772419e+01, 1.6791484e+02, 4.5643985e+02, - 8.3599854e+00, 7.4287776e+07, 2.0193510e+08, 6.7741680e+04, - 1.2407322e+03, 3.3726597e+03, 9.1678398e+03, 3.0754671e+00, - 8.3599854e+00, 7.4287776e+07, 2.0193510e+08, 6.7741680e+04]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/fully_connected_float_2_weights_as_inputs.mod.py b/tests/nnapi/specs/Ex/fully_connected_float_2_weights_as_inputs.mod.py new file mode 100644 index 000000000..6f13a213b --- /dev/null +++ b/tests/nnapi/specs/Ex/fully_connected_float_2_weights_as_inputs.mod.py @@ -0,0 +1,57 @@ +# +# Copyright (c) 2019 Samsung Electronics Co., Ltd. +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +model = Model() +in0 = Input("op1", "TENSOR_FLOAT32", "{3, 1}") +weights = Input("op2", "TENSOR_FLOAT32", "{1, 1}") +bias = Input("b0", "TENSOR_FLOAT32", "{1}") +out0 = Output("op3", "TENSOR_FLOAT32", "{3, 1}") +act = Int32Scalar("act", 0) +model = model.Operation("FULLY_CONNECTED", in0, weights, bias, act).To(out0) + +# Example 1. Input in operand 0, +input0 = {in0: # input 0 + [2, 32, 16], + weights: [2], + bias: [4]} +output0 = {out0: # output 0 + [8, 68, 36]} + +# Instantiate an example +Example((input0, output0)) + +# Example 2. Input in operand 0, +input1 = {in0: # input 0 + [2, 32, 16], + weights: [4], + bias: [4]} +output1 = {out0: # output 0 + [12, 132, 68]} + +Example((input1, output1)) + +# Example 3. Input in operand 0, +input2 = {in0: # input 0 + [2, 32, 16], + weights: [10], + bias: [4]} +output2 = {out0: # output 0 + [24, 324, 164]} + +# Instantiate an example +Example((input2, output2)) + diff --git a/tests/nnapi/specs/Ex/gather_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/gather_ex_1D_float.mod.py deleted file mode 100644 index eed3bf92d..000000000 --- a/tests/nnapi/specs/Ex/gather_ex_1D_float.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of 4 float32s -i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s -axis = Int32Scalar("axis", 0) -i3 = Output("op3", "TENSOR_FLOAT32", "{2}") # a vector of 2 float32s -model = model.Operation("GATHER_EX", i1, i2, axis).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.0, 4.0, 5.0, 6.0], - i2: # input 1 - [2, 0]} - -output0 = {i3: # output 0 - [5.0, 3.0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/gather_ex_1D_int32.mod.py b/tests/nnapi/specs/Ex/gather_ex_1D_int32.mod.py deleted file mode 100644 index 0eefbea58..000000000 --- a/tests/nnapi/specs/Ex/gather_ex_1D_int32.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_INT32", "{4}") # a vector of 4 int32s -i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s -axis = Int32Scalar("axis", 0) -i3 = Output("op3", "TENSOR_INT32", "{2}") # a vector of 2 int32s -model = model.Operation("GATHER_EX", i1, i2, axis).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [40000, 41000, 50000, 60000], - i2: # input 1 - [2, 0]} - -output0 = {i3: # output 0 - [50000, 40000]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/gather_ex_1D_quant8.mod.py b/tests/nnapi/specs/Ex/gather_ex_1D_quant8.mod.py deleted file mode 100644 index f3276162f..000000000 --- a/tests/nnapi/specs/Ex/gather_ex_1D_quant8.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{4}, 0.5f, 1") # a vector of 4 qasymm8s -i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s -axis = Int32Scalar("axis", 0) -i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{2}, 0.5f, 1") # another vector of 2 qasymm8s -model = model.Operation("GATHER_EX", i1, i2, axis).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [7, 9, 11, 13], - i2: # input 1 - [2, 0]} - -output0 = {i3: # output 0 - [11, 7]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/gather_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/gather_ex_2D_float.mod.py deleted file mode 100644 index 52f7bf12f..000000000 --- a/tests/nnapi/specs/Ex/gather_ex_2D_float.mod.py +++ /dev/null @@ -1,22 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}") # a vector of 12 float32s -i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s -axis = Int32Scalar("axis", 0) -i3 = Output("op3", "TENSOR_FLOAT32", "{2,4}") # a vector of 8 float32s -model = model.Operation("GATHER_EX", i1, i2, axis).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789], - i2: # input 1 - [2, 0]} - -output0 = {i3: # output 0 - [2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789, - 3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/gather_ex_2D_int32.mod.py b/tests/nnapi/specs/Ex/gather_ex_2D_int32.mod.py deleted file mode 100644 index 357efd08f..000000000 --- a/tests/nnapi/specs/Ex/gather_ex_2D_int32.mod.py +++ /dev/null @@ -1,22 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_INT32", "{3,4}") # a vector of 12 int32s -i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s -axis = Int32Scalar("axis", 0) -i3 = Output("op3", "TENSOR_INT32", "{2,4}") # a vector of 8 int32s -model = model.Operation("GATHER_EX", i1, i2, axis).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [40000, 41000, 50000, 60000, - 70000, 80000, 90000, 79000, - 170000, 180000, 190000, 110000], - i2: # input 1 - [2, 0]} - -output0 = {i3: # output 0 - [170000, 180000, 190000, 110000, - 40000, 41000, 50000, 60000]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/gather_ex_2D_quant8.mod.py b/tests/nnapi/specs/Ex/gather_ex_2D_quant8.mod.py deleted file mode 100644 index 8e4eb04ec..000000000 --- a/tests/nnapi/specs/Ex/gather_ex_2D_quant8.mod.py +++ /dev/null @@ -1,22 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{3,4}, 0.5f, 1") # a vector of 12 qasymm8s -i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s -axis = Int32Scalar("axis", 0) -i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{2,4}, 0.5f, 1") # a vector of 8 qasymm8s -model = model.Operation("GATHER_EX", i1, i2, axis).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [7, 9, 11, 13, - 15, 17, 19, 3, - 5, 37, 39, 23], - i2: # input 1 - [2, 0]} - -output0 = {i3: # output 0 - [5, 37, 39, 23, - 7, 9, 11, 13]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/greater_equal_ex.mod.py b/tests/nnapi/specs/Ex/greater_equal_ex.mod.py new file mode 100644 index 000000000..7c62d568b --- /dev/null +++ b/tests/nnapi/specs/Ex/greater_equal_ex.mod.py @@ -0,0 +1,35 @@ +# +# Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# model +model = Model() +i1 = Input("op1", "TENSOR_FLOAT32", "{2, 1}") +i2 = Input("op2", "TENSOR_FLOAT32", "{2}") +i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{2, 2}, 1.0, 0") +model = model.Operation("GREATER_EQUAL_EX", i1, i2).To(i3) + +# Example 1. Input in operand 0, +input0 = {i1: # input 0 + [5, 10], + i2: # input 1 + [10, 5]} + +output0 = {i3: # output 0 + [0, 255, 255, 255]} + +# Instantiate an example +Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/less_ex.mod.py b/tests/nnapi/specs/Ex/less_ex.mod.py new file mode 100644 index 000000000..3ae15b62f --- /dev/null +++ b/tests/nnapi/specs/Ex/less_ex.mod.py @@ -0,0 +1,35 @@ +# +# Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# model +model = Model() +i1 = Input("op1", "TENSOR_FLOAT32", "{2, 1}") +i2 = Input("op2", "TENSOR_FLOAT32", "{2}") +i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{2, 2}, 1.0, 0") +model = model.Operation("LESS_EX", i1, i2).To(i3) + +# Example 1. Input in operand 0, +input0 = {i1: # input 0 + [5, 10], + i2: # input 1 + [10, 5]} + +output0 = {i3: # output 0 + [255, 0, 0, 0]} + +# Instantiate an example +Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/neg_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/neg_ex_1D_float.mod.py deleted file mode 100644 index d66298099..000000000 --- a/tests/nnapi/specs/Ex/neg_ex_1D_float.mod.py +++ /dev/null @@ -1,15 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of input -i2 = Output("op2", "TENSOR_FLOAT32", "{4}") # a vector of output -model = model.Operation("NEG_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.0, 4.0, 5.0, 6.0]} - -output0 = {i2: # output 0 - [-3.0, -4.0, -5.0, -6.0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/neg_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/neg_ex_2D_float.mod.py deleted file mode 100644 index 829fedea8..000000000 --- a/tests/nnapi/specs/Ex/neg_ex_2D_float.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}") -i2 = Output("op2", "TENSOR_FLOAT32", "{3,4}") -model = model.Operation("NEG_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]} - -output0 = {i2: # output 0 - [-3.123456789123456789, -4.123456789123456789, -5.123456789123456789, -6.123456789123456789, - -7.123456789123456789, -8.123456789123456789, -9.123456789123456789, -1.123456789123456789, - -2.123456789123456789, -18.123456789123456789, -19.123456789123456789, -11.123456789123456789]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/neg_ex_3D_float.mod.py b/tests/nnapi/specs/Ex/neg_ex_3D_float.mod.py deleted file mode 100644 index 1f57c49f2..000000000 --- a/tests/nnapi/specs/Ex/neg_ex_3D_float.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2,3,4}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2,3,4}") -model = model.Operation("NEG_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789, - 40.123456789123456789, 42.123456789123456789, 4.123456789123456789, 12.123456789123456789, - 22.123456789123456789, 32.123456789123456789, 62.123456789123456789, 52.123456789123456789, - 92.123456789123456789, 59.123456789123456789, 69.123456789123456789, 312.123456789123456789]} - -output0 = {i2: # output 0 - [-3.123456789123456789, -4.123456789123456789, -5.123456789123456789, -6.123456789123456789, - -7.123456789123456789, -8.123456789123456789, -9.123456789123456789, -1.123456789123456789, - -2.123456789123456789, -18.123456789123456789, -19.123456789123456789, -11.123456789123456789, - -40.123456789123456789, -42.123456789123456789, -4.123456789123456789, -12.123456789123456789, - -22.123456789123456789, -32.123456789123456789, -62.123456789123456789, -52.123456789123456789, - -92.123456789123456789, -59.123456789123456789, -69.123456789123456789, -312.123456789123456789]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/neg_ex_3D_int.mod.py b/tests/nnapi/specs/Ex/neg_ex_3D_int.mod.py deleted file mode 100644 index 56dbec1d7..000000000 --- a/tests/nnapi/specs/Ex/neg_ex_3D_int.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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/tests/nnapi/specs/Ex/neg_ex_4D_float.mod.py b/tests/nnapi/specs/Ex/neg_ex_4D_float.mod.py deleted file mode 100644 index 4d1b10d08..000000000 --- a/tests/nnapi/specs/Ex/neg_ex_4D_float.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2,3,2,2}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2,3,2,2}") -model = model.Operation("NEG_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789, - 40.123456789123456789, 42.123456789123456789, 4.123456789123456789, 12.123456789123456789, - 22.123456789123456789, 32.123456789123456789, 62.123456789123456789, 52.123456789123456789, - 92.123456789123456789, 59.123456789123456789, 69.123456789123456789, 312.123456789123456789]} - -output0 = {i2: # output 0 - [-3.123456789123456789, -4.123456789123456789, -5.123456789123456789, -6.123456789123456789, - -7.123456789123456789, -8.123456789123456789, -9.123456789123456789, -1.123456789123456789, - -2.123456789123456789, -18.123456789123456789, -19.123456789123456789, -11.123456789123456789, - -40.123456789123456789, -42.123456789123456789, -4.123456789123456789, -12.123456789123456789, - -22.123456789123456789, -32.123456789123456789, -62.123456789123456789, -52.123456789123456789, - -92.123456789123456789, -59.123456789123456789, -69.123456789123456789, -312.123456789123456789]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/neg_ex_4D_int.mod.py b/tests/nnapi/specs/Ex/neg_ex_4D_int.mod.py deleted file mode 100644 index ac90eb361..000000000 --- a/tests/nnapi/specs/Ex/neg_ex_4D_int.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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)) diff --git a/tests/nnapi/specs/Ex/pack_ex_3D_float_1.mod.py b/tests/nnapi/specs/Ex/pack_ex_2D_float_1.mod.py index 3f3ea683f..06f6e6a7b 100644 --- a/tests/nnapi/specs/Ex/pack_ex_3D_float_1.mod.py +++ b/tests/nnapi/specs/Ex/pack_ex_2D_float_1.mod.py @@ -1,11 +1,11 @@ # Sample Stack or Pack model model = Model() -i1 = Input("input1", "TENSOR_FLOAT32", "{2, 3, 4}") -i2 = Input("input2", "TENSOR_FLOAT32", "{2, 3, 4}") -i3 = Input("input3", "TENSOR_FLOAT32", "{2, 3, 4}") +i1 = Input("input1", "TENSOR_FLOAT32", "{6, 4}") +i2 = Input("input2", "TENSOR_FLOAT32", "{6, 4}") +i3 = Input("input3", "TENSOR_FLOAT32", "{6, 4}") num = Int32Scalar("num_tensors", 3) axis = Int32Scalar("axis", 0) -out = Output("output", "TENSOR_FLOAT32", "{3, 2, 3, 4}") +out = Output("output", "TENSOR_FLOAT32", "{3, 6, 4}") model = model.Operation("PACK_EX", i1, i2, i3, num, axis).To(out) input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/pack_ex_3D_float_2.mod.py b/tests/nnapi/specs/Ex/pack_ex_2D_float_2.mod.py index d0caa02cc..acc8c891f 100644 --- a/tests/nnapi/specs/Ex/pack_ex_3D_float_2.mod.py +++ b/tests/nnapi/specs/Ex/pack_ex_2D_float_2.mod.py @@ -1,11 +1,11 @@ # Sample Stack or Pack model model = Model() -i1 = Input("input1", "TENSOR_FLOAT32", "{2, 3, 4}") -i2 = Input("input2", "TENSOR_FLOAT32", "{2, 3, 4}") -i3 = Input("input3", "TENSOR_FLOAT32", "{2, 3, 4}") +i1 = Input("input1", "TENSOR_FLOAT32", "{6, 4}") +i2 = Input("input2", "TENSOR_FLOAT32", "{6, 4}") +i3 = Input("input3", "TENSOR_FLOAT32", "{6, 4}") num = Int32Scalar("num_tensors", 3) -axis = Int32Scalar("axis", 2) -out = Output("output", "TENSOR_FLOAT32", "{2, 3, 3, 4}") +axis = Int32Scalar("axis", 1) +out = Output("output", "TENSOR_FLOAT32", "{6, 3, 4}") model = model.Operation("PACK_EX", i1, i2, i3, num, axis).To(out) input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/pack_ex_3D_int_1.mod.py b/tests/nnapi/specs/Ex/pack_ex_2D_int_1.mod.py index 23b365957..0ffd6cf9d 100644 --- a/tests/nnapi/specs/Ex/pack_ex_3D_int_1.mod.py +++ b/tests/nnapi/specs/Ex/pack_ex_2D_int_1.mod.py @@ -1,11 +1,11 @@ # Sample Stack or Pack model model = Model() -i1 = Input("input1", "TENSOR_INT32", "{2, 3, 4}") -i2 = Input("input2", "TENSOR_INT32", "{2, 3, 4}") -i3 = Input("input3", "TENSOR_INT32", "{2, 3, 4}") +i1 = Input("input1", "TENSOR_INT32", "{6, 4}") +i2 = Input("input2", "TENSOR_INT32", "{6, 4}") +i3 = Input("input3", "TENSOR_INT32", "{6, 4}") num = Int32Scalar("num_tensors", 3) axis = Int32Scalar("axis", 0) -out = Output("output", "TENSOR_INT32", "{3, 2, 3, 4}") +out = Output("output", "TENSOR_INT32", "{3, 6, 4}") model = model.Operation("PACK_EX", i1, i2, i3, num, axis).To(out) input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/pack_ex_3D_int_2.mod.py b/tests/nnapi/specs/Ex/pack_ex_2D_int_2.mod.py index 747fcc628..c9bdc419b 100644 --- a/tests/nnapi/specs/Ex/pack_ex_3D_int_2.mod.py +++ b/tests/nnapi/specs/Ex/pack_ex_2D_int_2.mod.py @@ -1,11 +1,11 @@ # Sample Stack or Pack model model = Model() -i1 = Input("input1", "TENSOR_INT32", "{2, 3, 4}") -i2 = Input("input2", "TENSOR_INT32", "{2, 3, 4}") -i3 = Input("input3", "TENSOR_INT32", "{2, 3, 4}") +i1 = Input("input1", "TENSOR_INT32", "{6, 4}") +i2 = Input("input2", "TENSOR_INT32", "{6, 4}") +i3 = Input("input3", "TENSOR_INT32", "{6, 4}") num = Int32Scalar("num_tensors", 3) -axis = Int32Scalar("axis", 2) -out = Output("output", "TENSOR_INT32", "{2, 3, 3, 4}") +axis = Int32Scalar("axis", 1) +out = Output("output", "TENSOR_INT32", "{6, 3, 4}") model = model.Operation("PACK_EX", i1, i2, i3, num, axis).To(out) input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/prelu_ex_broadcast_float_1.mod.py b/tests/nnapi/specs/Ex/prelu_ex_broadcast_float_1.mod.py new file mode 100644 index 000000000..23e363f5c --- /dev/null +++ b/tests/nnapi/specs/Ex/prelu_ex_broadcast_float_1.mod.py @@ -0,0 +1,23 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_FLOAT32", "{1, 2, 2, 3}") # a vector of input +i2 = Input("op2", "TENSOR_FLOAT32", "{1, 1, 1, 3}") # a vector of alpha +i3 = Output("op3", "TENSOR_FLOAT32", "{1, 2, 2, 3}") # a vector of output +model = model.Operation("PRELU_EX", i1, i2).To(i3) + +# Example 1. Input in operand 0, +input0 = {i1: # input 0 + [0.0, 0.0, 0.0, + 1.0, 1.0, 1.0, + -1.0, -1.0, -1.0, + -2.0, -2.0, -2.0], + i2: # input 1 + [0.0, 1.0, 2.0]} + +output0 = {i3: # output 0 + [0.0, 0.0, 0.0, + 1.0, 1.0, 1.0, + 0.0, -1.0, -2.0, + 0.0, -2.0, -4.0]} +# Instantiate an example +Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/prelu_ex_broadcast_quant8_1.mod.py b/tests/nnapi/specs/Ex/prelu_ex_broadcast_quant8_1.mod.py new file mode 100644 index 000000000..5fc6884bc --- /dev/null +++ b/tests/nnapi/specs/Ex/prelu_ex_broadcast_quant8_1.mod.py @@ -0,0 +1,24 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{1, 2, 2, 3}, 1.0f, 2") # a vector of input +i2 = Input("op2", "TENSOR_QUANT8_ASYMM", "{1, 1, 3}, 1.0f, 1") # a vector of alpha +i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{1, 2, 2, 3}, 0.5f, 3") # a vector of output +model = model.Operation("PRELU_EX", i1, i2).To(i3) + +# Example 1. Input in operand 0, +input0 = {i1: # input 0 + [1, 1, 1, + 2, 2, 2, + 3, 3, 3, + 1, 2, 3], + i2: # input 1 + [0, 1, 2]} + +output0 = {i3: # output 0 + [5, 3, 1, + 3, 3, 3, + 5, 5, 5, + 5, 3, 5]} +# Instantiate an example +Example((input0, output0)) + diff --git a/tests/nnapi/specs/Ex/prelu_ex_float_2.mod.py b/tests/nnapi/specs/Ex/prelu_ex_float_2.mod.py deleted file mode 100644 index d2ebd2a0b..000000000 --- a/tests/nnapi/specs/Ex/prelu_ex_float_2.mod.py +++ /dev/null @@ -1,22 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{1, 2, 2, 1}") # a vector of input -i2 = Input("op2", "TENSOR_FLOAT32", "{1, 2, 2, 1}") # a vector of alpha -i3 = Output("op3", "TENSOR_FLOAT32", "{1, 2, 2, 1}") # a vector of output -model = model.Operation("PRELU_EX", i1, i2).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.0, -2.0, - -1.0, -2.0 - ], - i2: # input 1 - [0.0, 1.0, - 1.0, 2.0]} - -output0 = {i3: # output 0 - [3.0, -2.0, - -1.0, -4.0 - ]} -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/prelu_ex_quant8_1.mod.py b/tests/nnapi/specs/Ex/prelu_ex_quant8_1.mod.py new file mode 100644 index 000000000..9548f8255 --- /dev/null +++ b/tests/nnapi/specs/Ex/prelu_ex_quant8_1.mod.py @@ -0,0 +1,23 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{1, 2, 2, 1}, 0.5f, 5") # a vector of input +i2 = Input("op2", "TENSOR_QUANT8_ASYMM", "{1, 2, 2, 1}, 0.5f, 1") # a vector of alpha +i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{1, 2, 2, 1}, 0.1f, 3") # a vector of output +model = model.Operation("PRELU_EX", i1, i2).To(i3) + +# Example 1. Input in operand 0, +input0 = {i1: # input 0 + [3, 1, + 7, 11 + ], + i2: # input 1 + [0, 1, + 2, 2]} + +output0 = {i3: # output 0 + [8, 3, + 13, 33 + ]} +# Instantiate an example +Example((input0, output0)) + diff --git a/tests/nnapi/specs/Ex/reduce_min_ex_float.mod.py b/tests/nnapi/specs/Ex/reduce_min_ex_float.mod.py index a58c2dba5..f6b29f657 100644 --- a/tests/nnapi/specs/Ex/reduce_min_ex_float.mod.py +++ b/tests/nnapi/specs/Ex/reduce_min_ex_float.mod.py @@ -1,9 +1,10 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 1}") axis = Parameter("axis", "TENSOR_INT32", "{1}", [2]) +keepDims = Int32Scalar("keepDims", 0) output = Output("output", "TENSOR_FLOAT32", "{1, 2, 1}") -model = model.Operation("REDUCE_MIN_EX", i1, axis).To(output) +model = model.Operation("REDUCE_MIN_EX", i1, axis, keepDims).To(output) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/reduce_min_ex_float_1.mod.py b/tests/nnapi/specs/Ex/reduce_min_ex_float_1.mod.py index 50b23bb8a..a58e12dc3 100644 --- a/tests/nnapi/specs/Ex/reduce_min_ex_float_1.mod.py +++ b/tests/nnapi/specs/Ex/reduce_min_ex_float_1.mod.py @@ -1,9 +1,10 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{4, 3, 2}") axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 0, -3, -3]) +keepDims = Int32Scalar("keepDims", 0) output = Output("output", "TENSOR_FLOAT32", "{2}") -model = model.Operation("REDUCE_MIN_EX", i1, axis).To(output) +model = model.Operation("REDUCE_MIN_EX", i1, axis, keepDims).To(output) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/reduce_min_ex_float_2.mod.py b/tests/nnapi/specs/Ex/reduce_min_ex_float_2.mod.py index 087ce63b0..b817ed208 100644 --- a/tests/nnapi/specs/Ex/reduce_min_ex_float_2.mod.py +++ b/tests/nnapi/specs/Ex/reduce_min_ex_float_2.mod.py @@ -1,9 +1,10 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{4, 3, 2}") axis = Parameter("axis", "TENSOR_INT32", "{2}", [0, 2]) +keepDims = Int32Scalar("keepDims", 1) output = Output("output", "TENSOR_FLOAT32", "{1, 3, 1}") -model = model.Operation("REDUCE_MIN_EX", i1, axis).To(output) +model = model.Operation("REDUCE_MIN_EX", i1, axis, keepDims).To(output) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/reduce_sum_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/reduce_sum_ex_2D_float.mod.py index 1368f66c5..2bd3b50c3 100644 --- a/tests/nnapi/specs/Ex/reduce_sum_ex_2D_float.mod.py +++ b/tests/nnapi/specs/Ex/reduce_sum_ex_2D_float.mod.py @@ -2,8 +2,9 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{3, 4}") axis = Int32Scalar("axis", 1) +keepDims = Int32Scalar("keepDims", 0) out1 = Output("output", "TENSOR_FLOAT32", "{3}") -model = model.Operation("REDUCE_SUM_EX", i1, axis).To(out1) +model = model.Operation("REDUCE_SUM_EX", i1, axis, keepDims).To(out1) # Example 1. Input in operand 0, 1 input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float.mod.py b/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float.mod.py index 15b8dd7b2..6a8e6ad5f 100644 --- a/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float.mod.py +++ b/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float.mod.py @@ -2,8 +2,9 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{1, 3, 4, 1}") axis = Int32Scalar("axis", 1) +keepDims = Int32Scalar("keepDims", 0) out1 = Output("output", "TENSOR_FLOAT32", "{1, 4, 1}") -model = model.Operation("REDUCE_SUM_EX", i1, axis).To(out1) +model = model.Operation("REDUCE_SUM_EX", i1, axis, keepDims).To(out1) # Example 1. Input in operand 0, 1 input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_C.mod.py b/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_C.mod.py index 4bfea0f97..5d751bd23 100644 --- a/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_C.mod.py +++ b/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_C.mod.py @@ -17,9 +17,10 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{%d, %d, %d, %d}" % (batch, rows, cols, depth)) # Axis value should be in the range [-(rank), rank). And '-n' is the same axis with 'rank - n'. So '3' and '-1' are the same axis. axis = Parameter("axis", "TENSOR_INT32", "{2}", [3, -1]) +keepDims = Int32Scalar("keepDims", 0) output = Output("output", "TENSOR_FLOAT32", "{%d, %d, %d}" % (batch, rows, cols)) -model = model.Operation("REDUCE_SUM_EX", i1, axis).To(output) +model = model.Operation("REDUCE_SUM_EX", i1, axis, keepDims).To(output) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_HW.mod.py b/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_HW.mod.py index d94bcf79c..7861030dc 100644 --- a/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_HW.mod.py +++ b/tests/nnapi/specs/Ex/reduce_sum_ex_4D_float_reducing_HW.mod.py @@ -17,9 +17,10 @@ model = Model() i1 = Input("input", "TENSOR_FLOAT32", "{%d, %d, %d, %d}" % (batch, rows, cols, depth)) # Axis value should be in the range [-(rank), rank). And '-n' is the same axis with 'rank - n'. So this test's axis value are the same [1, 2]. axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 2, -3, -2]) +keepDims = Int32Scalar("keepDims", 0) output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (batch, depth)) -model = model.Operation("REDUCE_SUM_EX", i1, axis).To(output) +model = model.Operation("REDUCE_SUM_EX", i1, axis, keepDims).To(output) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/rsqrt_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/rsqrt_ex_1D_float.mod.py deleted file mode 100644 index f052708cf..000000000 --- a/tests/nnapi/specs/Ex/rsqrt_ex_1D_float.mod.py +++ /dev/null @@ -1,13 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{4}") #A vector of inputs -i2 = Output("op2", "TENSOR_FLOAT32", "{4}") #A vector of outputs -model = model.Operation("RSQRT_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [36.0, 90.0, 43.0, 36.0]} -output0 = {i2: # output 0 - [0.166667, 0.105409, 0.152499, 0.166667]} -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/rsqrt_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/rsqrt_ex_2D_float.mod.py deleted file mode 100644 index 5f475ae58..000000000 --- a/tests/nnapi/specs/Ex/rsqrt_ex_2D_float.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() - -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2}") -i3 = Output("op3", "TENSOR_FLOAT32", "{2, 2}") -model = model.Operation("RSQRT_EX", i1).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1.0, 2.0, 4.0, 8.0]} - -output0 = {i3: # output 0 - [1.0, - 0.70710678118, - 0.5, - 0.35355339059]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/rsqrt_ex_3D_float.mod.py b/tests/nnapi/specs/Ex/rsqrt_ex_3D_float.mod.py deleted file mode 100644 index 48abf8c18..000000000 --- a/tests/nnapi/specs/Ex/rsqrt_ex_3D_float.mod.py +++ /dev/null @@ -1,16 +0,0 @@ -# model -model = Model() - -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2}") -i3 = Output("op3", "TENSOR_FLOAT32", "{2, 2, 2}") -model = model.Operation("RSQRT_EX", i1).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1.0, 36.0, 2.0, 90, 4.0, 43.0, 8.0, 36.0]} - -output0 = {i3: # output 0 - [1.0, 0.166667, 0.70710678118, 0.105409, 0.5, 0.152499, 0.35355339059, 0.166667]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/rsqrt_ex_4D_float.mod.py b/tests/nnapi/specs/Ex/rsqrt_ex_4D_float.mod.py deleted file mode 100644 index 6a1ae3c00..000000000 --- a/tests/nnapi/specs/Ex/rsqrt_ex_4D_float.mod.py +++ /dev/null @@ -1,18 +0,0 @@ -# model -model = Model() - -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2, 2}") -i3 = Output("op3", "TENSOR_FLOAT32", "{2, 2, 2, 2}") -model = model.Operation("RSQRT_EX", i1).To(i3) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1.0, 36.0, 2.0, 90, 4.0, 16.0, 25.0, 100.0, - 23.0, 19.0, 40.0, 256.0, 4.0, 43.0, 8.0, 36.0]} - -output0 = {i3: # output 0 - [1.0, 0.166667, 0.70710678118, 0.105409, 0.5, 0.25, 0.2, 0.1, - 0.208514, 0.229416, 0.158114, 0.0625, 0.5, 0.152499, 0.35355339059, 0.166667]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/split_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/split_ex_1D_float.mod.py index 97b61462e..137ece828 100644 --- a/tests/nnapi/specs/Ex/split_ex_1D_float.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_1D_float.mod.py @@ -2,6 +2,7 @@ model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{8}") axis = Int32Scalar("axis", 0) +num_out = Int32Scalar("num_out", 8) i2 = Output("op2", "TENSOR_FLOAT32", "{1}") i3 = Output("op3", "TENSOR_FLOAT32", "{1}") i4 = Output("op4", "TENSOR_FLOAT32", "{1}") @@ -11,7 +12,7 @@ i7 = Output("op7", "TENSOR_FLOAT32", "{1}") i8 = Output("op8", "TENSOR_FLOAT32", "{1}") i9 = Output("op9", "TENSOR_FLOAT32", "{1}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3, i4, i5, i6, i7, i8, i9]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3, i4, i5, i6, i7, i8, i9]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_1D_int32.mod.py b/tests/nnapi/specs/Ex/split_ex_1D_int32.mod.py index 378b37707..9bfc215f6 100644 --- a/tests/nnapi/specs/Ex/split_ex_1D_int32.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_1D_int32.mod.py @@ -2,6 +2,7 @@ model = Model() i1 = Input("op1", "TENSOR_INT32", "{8}") axis = Int32Scalar("axis", 0) +num_out = Int32Scalar("num_out", 8) i2 = Output("op2", "TENSOR_INT32", "{1}") i3 = Output("op3", "TENSOR_INT32", "{1}") i4 = Output("op4", "TENSOR_INT32", "{1}") @@ -11,7 +12,7 @@ i7 = Output("op7", "TENSOR_INT32", "{1}") i8 = Output("op8", "TENSOR_INT32", "{1}") i9 = Output("op9", "TENSOR_INT32", "{1}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3, i4, i5, i6, i7, i8, i9]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3, i4, i5, i6, i7, i8, i9]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_float_1.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_float_1.mod.py index 3059fae7c..2353a8a0f 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_float_1.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_float_1.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{2,2,2,2}") axis = Int32Scalar("axis", 0) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_FLOAT32", "{1,2,2,2}") i3 = Output("op3", "TENSOR_FLOAT32", "{1,2,2,2}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_float_2.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_float_2.mod.py index faa59bc3c..30ecf2416 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_float_2.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_float_2.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{2,2,2,2}") axis = Int32Scalar("axis", 3) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_FLOAT32", "{2,2,2,1}") i3 = Output("op3", "TENSOR_FLOAT32", "{2,2,2,1}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_float_3.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_float_3.mod.py index 2091e4b4a..1f7a07880 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_float_3.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_float_3.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{2,2,2,2}") axis = Int32Scalar("axis", -4) # Negative axis +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_FLOAT32", "{1,2,2,2}") i3 = Output("op3", "TENSOR_FLOAT32", "{1,2,2,2}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_int32_1.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_int32_1.mod.py index 3e9438f50..b1c6692ee 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_int32_1.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_int32_1.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_INT32", "{2,2,2,2}") axis = Int32Scalar("axis", 0) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_INT32", "{1,2,2,2}") i3 = Output("op3", "TENSOR_INT32", "{1,2,2,2}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_int32_2.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_int32_2.mod.py index 83253cb14..88a7cca48 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_int32_2.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_int32_2.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_INT32", "{2,2,2,2}") axis = Int32Scalar("axis", 1) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_INT32", "{2,1,2,2}") i3 = Output("op3", "TENSOR_INT32", "{2,1,2,2}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_int32_3.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_int32_3.mod.py index b20b2053b..6f5cc621b 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_int32_3.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_int32_3.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_INT32", "{2,2,2,2}") axis = Int32Scalar("axis", 2) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_INT32", "{2,2,1,2}") i3 = Output("op3", "TENSOR_INT32", "{2,2,1,2}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_int32_4.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_int32_4.mod.py index 3c255cc48..fb6710171 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_int32_4.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_int32_4.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_INT32", "{2,2,2,2}") axis = Int32Scalar("axis", 3) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_INT32", "{2,2,2,1}") i3 = Output("op3", "TENSOR_INT32", "{2,2,2,1}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_int32_5.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_int32_5.mod.py index 30e5e245d..338794855 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_int32_5.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_int32_5.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_INT32", "{2,2,2,2}") axis = Int32Scalar("axis", -4) # Negative axis +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_INT32", "{1,2,2,2}") i3 = Output("op3", "TENSOR_INT32", "{1,2,2,2}") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/split_ex_4D_quant8.mod.py b/tests/nnapi/specs/Ex/split_ex_4D_quant8.mod.py index 46cb3ab78..a3dbffaa9 100644 --- a/tests/nnapi/specs/Ex/split_ex_4D_quant8.mod.py +++ b/tests/nnapi/specs/Ex/split_ex_4D_quant8.mod.py @@ -2,9 +2,10 @@ model = Model() i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{2,2,2,2}, 0.5f, 1") axis = Int32Scalar("axis", 0) +num_out = Int32Scalar("num_out", 2) i2 = Output("op2", "TENSOR_QUANT8_ASYMM", "{1,2,2,2}, 0.5f, 1") i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{1,2,2,2}, 0.5f, 1") -model = model.Operation("SPLIT_EX", axis, i1).To([i2, i3]) +model = model.Operation("SPLIT_EX", i1, axis, num_out).To([i2, i3]) # Example 1. Input in operand 0, input0 = {i1: # input 0 diff --git a/tests/nnapi/specs/Ex/sqrt_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/sqrt_ex_1D_float.mod.py deleted file mode 100644 index fa6a01c54..000000000 --- a/tests/nnapi/specs/Ex/sqrt_ex_1D_float.mod.py +++ /dev/null @@ -1,15 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of input -i2 = Output("op2", "TENSOR_FLOAT32", "{4}") # a vector of output -model = model.Operation("SQRT_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [62.0, 5.0, 73.0, 34.0]} - -output0 = {i2: # output 0 - [7.87400787, 2.23606798, 8.54400375, 5.83095189]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/sqrt_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/sqrt_ex_2D_float.mod.py deleted file mode 100644 index d5e816fd4..000000000 --- a/tests/nnapi/specs/Ex/sqrt_ex_2D_float.mod.py +++ /dev/null @@ -1,13 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2, 2}") -model = model.Operation("SQRT_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [36, 2, 9, 12]} -output0 = {i2: # output 0 - [6.0, 1.41421356, 3.0, 3.46410162]} -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/sqrt_ex_3D_float.mod.py b/tests/nnapi/specs/Ex/sqrt_ex_3D_float.mod.py deleted file mode 100644 index d96a89653..000000000 --- a/tests/nnapi/specs/Ex/sqrt_ex_3D_float.mod.py +++ /dev/null @@ -1,14 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2, 2, 2}") -model = model.Operation("SQRT_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [90, 36, 22, 10, 9, 80, 40, 18]} -output0 = {i2: # output 0 - [9.48683298, 6.0, 4.69041576, 3.16227766, - 3.0, 8.94427191, 6.32455532, 4.24264069]} -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/sqrt_ex_4D_float.mod.py b/tests/nnapi/specs/Ex/sqrt_ex_4D_float.mod.py deleted file mode 100644 index 55561ba0f..000000000 --- a/tests/nnapi/specs/Ex/sqrt_ex_4D_float.mod.py +++ /dev/null @@ -1,14 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{2, 2, 2, 2}") -i2 = Output("op2", "TENSOR_FLOAT32", "{2, 2, 2, 2}") -model = model.Operation("SQRT_EX", i1).To(i2) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [36, 90, 43, 36, 2, 22, 19, 10, 9, 80, 40, 90, 15, 56, 18, 12]} -output0 = {i2: # output 0 - [6.0, 9.48683298, 6.55743852, 6.0, 1.41421356, 4.69041576, 4.35889894, 3.16227766, - 3.0, 8.94427191, 6.32455532, 9.48683298, 3.87298335, 7.48331477, 4.24264069, 3.46410162]} -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_2D_float.mod.py deleted file mode 100644 index 6cf8d83e7..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_2D_float.mod.py +++ /dev/null @@ -1,18 +0,0 @@ -# model -model = Model() -i1 = Input("input", "TENSOR_FLOAT32", "{3, 4}") -axis = Int32Scalar("axis", 1) -out1 = Output("output", "TENSOR_FLOAT32", "{3}") -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(out1) - -# Example 1. Input in operand 0, 1 -input0 = {i1: # input 0 - [3.2, 11.47, 3.8, 5.76, - 28.2, 0.999, -1.3, -13.5, - -3.4, -22.1, -2.2, -49.7]} - -output0 = {out1: # output 0 - [11.47, 28.2, -2.2]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_2D_int32.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_2D_int32.mod.py deleted file mode 100644 index 940dab3c3..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_2D_int32.mod.py +++ /dev/null @@ -1,18 +0,0 @@ -# model -model = Model() -i1 = Input("input", "TENSOR_INT32", "{3, 4}") -axis = Int32Scalar("axis", 1) -out1 = Output("output", "TENSOR_INT32", "{3}") -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(out1) - -# Example 1. Input in operand 0, 1 -input0 = {i1: # input 0 - [3, 11, 3, 5, - 28, 0, -1, -13, - -4, -22, -2, -49]} - -output0 = {out1: # output 0 - [11, 28, -2]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_C.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_C.mod.py deleted file mode 100644 index 82a5dbb93..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_C.mod.py +++ /dev/null @@ -1,34 +0,0 @@ -batch = 2 -rows = 3 -cols = 4 -depth = 5 - -input_table = [x for x in range(batch * rows * cols * depth)] -for i in range(batch): - for j in range(rows): - for k in range(cols): - for l in range(depth): - input_table[i * rows * cols * depth + j * cols * depth + k * depth + l] = i * rows * cols * depth + j * cols * depth + k * depth + l; - -output_table = [x for x in range(batch * rows * cols)] -for i in range(batch): - for j in range(rows): - for k in range(cols): - output_table[i * rows * cols + j * cols + k] = i * rows * cols * depth + j * cols * depth + k * depth + depth - 1; - -model = Model() -i1 = Input("input", "TENSOR_FLOAT32", "{%d, %d, %d, %d}" % (batch, rows, cols, depth)) -axis = Parameter("axis", "TENSOR_INT32", "{2}", [3, -1]) -output = Output("output", "TENSOR_FLOAT32", "{%d, %d, %d}" % (batch, rows, cols)) - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - input_table} - -output0 = {output: # output 0 - output_table} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_HW.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_HW.mod.py deleted file mode 100644 index a12762055..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_HW.mod.py +++ /dev/null @@ -1,34 +0,0 @@ -batch = 2 -rows = 3 -cols = 4 -depth = 5 - -input_table = [x for x in range(batch * rows * cols * depth)] -for i in range(batch): - for j in range(rows): - for k in range(cols): - for l in range(depth): - input_table[i * rows * cols * depth + j * cols * depth + k * depth + l] = i * rows * cols * depth + j * cols * depth + k * depth + l; - -# Since the axises to be reduced are {rows, cols} and the value of the input always increases in here, the output's values are i * rows * cols * depth + (rows - 1) * cols * depth + (cols - 1) * depth + l. -output_table = [x for x in range(batch * depth)] -for i in range(batch): - for l in range(depth): - output_table[i * depth + l] = i * rows * cols * depth + (rows - 1) * cols * depth + (cols - 1) * depth + l; - -model = Model() -i1 = Input("input", "TENSOR_FLOAT32", "{%d, %d, %d, %d}" % (batch, rows, cols, depth)) -axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 2, -3, -2]) -output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (batch, depth)) - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - input_table} - -output0 = {output: # output 0 - output_table} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_float.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_float.mod.py deleted file mode 100644 index 6de220721..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_float.mod.py +++ /dev/null @@ -1,18 +0,0 @@ -model = Model() -i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 1}") -axis = Parameter("axis", "TENSOR_INT32", "{1}", [2]) -output = Output("output", "TENSOR_FLOAT32", "{1, 2, 1}") - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1.0, 2.0, - 3.0, 4.0]} - -output0 = {output: # output 0 - [2.0, - 4.0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_float_1.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_float_1.mod.py deleted file mode 100644 index 42dc9d94b..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_float_1.mod.py +++ /dev/null @@ -1,17 +0,0 @@ -model = Model() -i1 = Input("input", "TENSOR_FLOAT32", "{4, 3, 2}") -axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 0, -3, -3]) -output = Output("output", "TENSOR_FLOAT32", "{2}") - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, - 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0]} - -output0 = {output: # output 0 - [23.0, 24.0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_float_2.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_float_2.mod.py deleted file mode 100644 index 98c0d9d03..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_float_2.mod.py +++ /dev/null @@ -1,17 +0,0 @@ -model = Model() -i1 = Input("input", "TENSOR_FLOAT32", "{4, 3, 2}") -axis = Parameter("axis", "TENSOR_INT32", "{2}", [0, 2]) -output = Output("output", "TENSOR_FLOAT32", "{1, 3, 1}") - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, - 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0]} - -output0 = {output: # output 0 - [20, 22, 24]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_1.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_1.mod.py deleted file mode 100644 index 8e85633b3..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_1.mod.py +++ /dev/null @@ -1,18 +0,0 @@ -model = Model() -i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{4, 3, 2}, 0.8, 5") -axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 0, -3, -3]) -output = Output("output", "TENSOR_QUANT8_ASYMM", "{2}, 0.8, 5") - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24]} - -output0 = {output: # output 0 - [23, 24]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_2.mod.py b/tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_2.mod.py deleted file mode 100644 index 75138b14a..000000000 --- a/tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_2.mod.py +++ /dev/null @@ -1,18 +0,0 @@ -model = Model() -i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{4, 3, 2}, 0.8, 5") -axis = Parameter("axis", "TENSOR_INT32", "{2}", [0, 2]) -output = Output("output", "TENSOR_QUANT8_ASYMM", "{1, 3, 1}, 0.8, 5") - -model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24]} - -output0 = {output: # output 0 - [20, 22, 24]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/topk_v2_ex_1D_float.mod.py b/tests/nnapi/specs/Ex/topk_v2_ex_1D_float.mod.py deleted file mode 100644 index 1e0ed21d6..000000000 --- a/tests/nnapi/specs/Ex/topk_v2_ex_1D_float.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of input -k = Int32Scalar("k", 2) -i2 = Output("op2", "TENSOR_FLOAT32", "{2}") # values of output -i3 = Output("op3", "TENSOR_INT32", "{2}") # indexes of output -model = model.Operation("TOPK_V2_EX", i1, k).To([i2, i3]) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [5.123456789123456789, 3.123456789123456789, 4.123456789123456789, 6.123456789123456789]} - -output0 = {i2: # output 0 - [6.123456789123456789, 5.123456789123456789], - i3: # output 1 - [3, 0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/topk_v2_ex_1D_int32.mod.py b/tests/nnapi/specs/Ex/topk_v2_ex_1D_int32.mod.py deleted file mode 100644 index d2bd39adf..000000000 --- a/tests/nnapi/specs/Ex/topk_v2_ex_1D_int32.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_INT32", "{4}") # a vector of input -k = Int32Scalar("k", 2) -i2 = Output("op2", "TENSOR_INT32", "{2}") # values of output -i3 = Output("op3", "TENSOR_INT32", "{2}") # indexes of output -model = model.Operation("TOPK_V2_EX", i1, k).To([i2, i3]) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [50000, 40000, 41000, 60000]} - -output0 = {i2: # output 0 - [60000, 50000], - i3: # output 1 - [3, 0]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/topk_v2_ex_1D_quant8.mod.py b/tests/nnapi/specs/Ex/topk_v2_ex_1D_quant8.mod.py deleted file mode 100644 index 6f36ce41f..000000000 --- a/tests/nnapi/specs/Ex/topk_v2_ex_1D_quant8.mod.py +++ /dev/null @@ -1,19 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{4}, 0.5f, 1") # a vector of input -k = Int32Scalar("k", 2) -i2 = Output("op2", "TENSOR_QUANT8_ASYMM", "{2}, 0.5f, 1") # values of output -i3 = Output("op3", "TENSOR_INT32", "{2}") # indexes of output -model = model.Operation("TOPK_V2_EX", i1, k).To([i2, i3]) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [7, 4, 5, 6]} - -output0 = {i2: # output 0 - [7, 6], - i3: # output 1 - [0, 3]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/topk_v2_ex_2D_float.mod.py b/tests/nnapi/specs/Ex/topk_v2_ex_2D_float.mod.py deleted file mode 100644 index 204bc143f..000000000 --- a/tests/nnapi/specs/Ex/topk_v2_ex_2D_float.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}") # a matirx of input -k = Int32Scalar("k", 2) -o1 = Output("op2", "TENSOR_FLOAT32", "{3,2}") # values of output -o2 = Output("op3", "TENSOR_INT32", "{3,2}") # indexes of output -model = model.Operation("TOPK_V2_EX", i1, k).To([o1, o2]) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789, - 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789, - 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]} - -output0 = {o1: # output 1 - [6.123456789123456789, 5.123456789123456789, - 9.123456789123456789, 8.123456789123456789, - 19.123456789123456789, 18.123456789123456789], - o2: # output 1 - [3, 2, - 2, 1, - 2, 1]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/topk_v2_ex_2D_int32.mod.py b/tests/nnapi/specs/Ex/topk_v2_ex_2D_int32.mod.py deleted file mode 100644 index b90a35488..000000000 --- a/tests/nnapi/specs/Ex/topk_v2_ex_2D_int32.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_INT32", "{3,4}") # a vector of input -k = Int32Scalar("k", 2) -i2 = Output("op2", "TENSOR_INT32", "{3,2}") # indexes of output -i3 = Output("op3", "TENSOR_INT32", "{3,2}") # values of output -model = model.Operation("TOPK_V2_EX", i1, k).To([i2, i3]) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [40000, 41000, 50000, 60000, - 70000, 80000, 90000, 79000, - 170000, 180000, 190000, 110000]} - -output0 = {i2: # output 0 - [60000, 50000, - 90000, 80000, - 190000, 180000], - i3: # output 1 - [3, 2, - 2, 1, - 2, 1]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/topk_v2_ex_2D_quant8.mod.py b/tests/nnapi/specs/Ex/topk_v2_ex_2D_quant8.mod.py deleted file mode 100644 index d8b5c6075..000000000 --- a/tests/nnapi/specs/Ex/topk_v2_ex_2D_quant8.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# model -model = Model() -i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{3,4}, 0.5f, 1") # a vector of input -k = Int32Scalar("k", 2) -i2 = Output("op2", "TENSOR_QUANT8_ASYMM", "{3,2}, 0.5f, 1") # values of output -i3 = Output("op3", "TENSOR_INT32", "{3,2}") # indexes of output -model = model.Operation("TOPK_V2_EX", i1, k).To([i2, i3]) - -# Example 1. Input in operand 0, -input0 = {i1: # input 0 - [3, 4, 5, 6, - 7, 8, 9, 1, - 2, 18, 19, 11]} - -output0 = {i2: # output 0 - [6, 5, - 9, 8, - 19, 18], - i3: # output 1 - [3, 2, - 2, 1, - 2, 1]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_float_1.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_float_1.mod.py index 82b59c3cf..c509835c8 100644 --- a/tests/nnapi/specs/Ex/transpose_conv_ex_float_1.mod.py +++ b/tests/nnapi/specs/Ex/transpose_conv_ex_float_1.mod.py @@ -1,7 +1,7 @@ # model model = Model() i0 = Input("op_shape", "TENSOR_INT32", "{4}") -weights = Input("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}") +weights = Parameter("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}", [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]) i1 = Input("in", "TENSOR_FLOAT32", "{1, 4, 4, 1}" ) pad = Int32Scalar("pad_same", 1) s_x = Int32Scalar("stride_x", 1) @@ -16,9 +16,7 @@ input0 = {i0: # output shape [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, - 13.0, 14.0, 15.0, 16.0], - weights: # input 1 - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]} + 13.0, 14.0, 15.0, 16.0]} output0 = {i2: # output 0 [29.0, 62.0, 83.0, 75.0, diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_float_2.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_float_2.mod.py index e209345c6..29030cede 100644 --- a/tests/nnapi/specs/Ex/transpose_conv_ex_float_2.mod.py +++ b/tests/nnapi/specs/Ex/transpose_conv_ex_float_2.mod.py @@ -1,7 +1,7 @@ # model model = Model() i0 = Input("op_shape", "TENSOR_INT32", "{4}") -weights = Input("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}") +weights = Parameter("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}", [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]) i1 = Input("in", "TENSOR_FLOAT32", "{1, 2, 2, 1}" ) pad = Int32Scalar("pad_valid", 2) s_x = Int32Scalar("stride_x", 2) @@ -13,9 +13,7 @@ model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To( input0 = {i0: # output shape [1, 5, 5, 1], i1: # input 0 - [1.0, 2.0, 3.0, 4.0], - weights: # input 1 - [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]} + [1.0, 2.0, 3.0, 4.0]} output0 = {i2: # output 0 [1.0, 2.0, 5.0, 4.0, 6.0, diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_float_3.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_float_3.mod.py index 056c5809d..6d0142faf 100644 --- a/tests/nnapi/specs/Ex/transpose_conv_ex_float_3.mod.py +++ b/tests/nnapi/specs/Ex/transpose_conv_ex_float_3.mod.py @@ -1,7 +1,10 @@ # model model = Model() i0 = Input("op_shape", "TENSOR_INT32", "{4}") -weights = Input("ker", "TENSOR_FLOAT32", "{2, 3, 3, 1}") +weights = Parameter("ker", "TENSOR_FLOAT32", "{2, 3, 3, 1}", + [1.0, 3.0, 5.0, 7.0, 9.0, 11.0, + 13.0, 15.0, 17.0, 2.0, 4.0, 6.0, + 8.0, 10.0, 12.0, 14.0, 16.0, 18.0]) i1 = Input("in", "TENSOR_FLOAT32", "{1, 2, 2, 1}" ) pad = Int32Scalar("pad_valid", 2) s_x = Int32Scalar("stride_x", 2) @@ -13,11 +16,7 @@ model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To( input0 = {i0: # output shape [1, 5, 5, 2], i1: # input 0 - [1.0, 2.0, 3.0, 4.0], - weights: # input 1 - [1.0, 3.0, 5.0, 7.0, 9.0, 11.0, - 13.0, 15.0, 17.0, 2.0, 4.0, 6.0, - 8.0, 10.0, 12.0, 14.0, 16.0, 18.0]} + [1.0, 2.0, 3.0, 4.0]} output0 = {i2: # output 0 [1.0, 2.0, 3.0, 4.0, 7.0, diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_float_4.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_float_4.mod.py new file mode 100644 index 000000000..de00e5f66 --- /dev/null +++ b/tests/nnapi/specs/Ex/transpose_conv_ex_float_4.mod.py @@ -0,0 +1,54 @@ +# model +batch = 1 +in_chans = 1 +out_chans = 1 +in_rows = 4 +in_cols = 4 +out_rows = 8 +out_cols = 8 +ker_rows = 3 +ker_cols = 3 +stride = 2 +# pad is 0 (left: 0 right: 1 top: 0 bottom: 1) +input_table = [x for x in range(batch * in_rows * in_cols * in_chans)] +kernel_table = [x for x in range(out_chans * ker_rows * ker_cols * in_chans)] +out_table = [0 for x in range(batch * out_rows * out_cols * out_chans)] + +for i in range(batch): + for j in range(in_rows): + for k in range(in_cols): + for l in range(in_chans): + out_row_origin = j * stride + out_col_origin = k * stride + input_value = input_table[((i * in_rows + j) * in_cols + k) * in_chans + l] + + for m in range(ker_rows): + for n in range(ker_cols): + for o in range(out_chans): + out_row = out_row_origin + m + out_col = out_col_origin + n + if (out_row < out_rows) and (out_col < out_cols) and (out_row >= 0) and (out_col >= 0): + kernel_value = kernel_table[((o * ker_rows + m) * ker_cols + n) * in_chans + l] + out_table[((i * out_rows + out_row) * out_cols + out_col) * out_chans + o] += (input_value * kernel_value) + +model = Model() +i0 = Input("op_shape", "TENSOR_INT32", "{4}") +weights = Parameter("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}", kernel_table) +i1 = Input("in", "TENSOR_FLOAT32", "{1, 4, 4, 1}" ) +pad = Int32Scalar("pad_same", 1) +s_x = Int32Scalar("stride_x", 2) +s_y = Int32Scalar("stride_y", 2) +i2 = Output("op", "TENSOR_FLOAT32", "{1, 8, 8, 1}") +model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To(i2) + +# Example 1. Input in operand 0, +input0 = {i0: # output shape + [1, 8, 8, 1], + i1: # input 0 + input_table} + +output0 = {i2: # output 0 + out_table} + +# Instantiate an example +Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_int_1.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_int_1.mod.py deleted file mode 100644 index fb8eb72be..000000000 --- a/tests/nnapi/specs/Ex/transpose_conv_ex_int_1.mod.py +++ /dev/null @@ -1,24 +0,0 @@ -# model -model = Model() -i0 = Input("op_shape", "TENSOR_INT32", "{4}") -weights = Input("ker", "TENSOR_INT32", "{1, 3, 3, 1}") -i1 = Input("in", "TENSOR_INT32", "{1, 4, 4, 1}" ) -pad = Int32Scalar("pad_same", 1) -s_x = Int32Scalar("stride_x", 1) -s_y = Int32Scalar("stride_y", 1) -i2 = Output("op", "TENSOR_INT32", "{1, 4, 4, 1}") -model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To(i2) - -# Example 1. Input in operand 0, -input0 = {i0: # output shape - [1, 4, 4, 1], - i1: # input 0 - [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], - weights: # input 1 - [1, 2, 3, 4, 5, 6, 7, 8, 9]} - -output0 = {i2: # output 0 - [29, 62, 83, 75, 99, 192, 237, 198, 207, 372, 417, 330, 263, 446, 485, 365]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_int_2.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_int_2.mod.py deleted file mode 100644 index 9bf4b113d..000000000 --- a/tests/nnapi/specs/Ex/transpose_conv_ex_int_2.mod.py +++ /dev/null @@ -1,25 +0,0 @@ -# model -model = Model() -i0 = Input("op_shape", "TENSOR_INT32", "{4}") -weights = Input("ker", "TENSOR_INT32", "{1, 3, 3, 1}") -i1 = Input("in", "TENSOR_INT32", "{1, 2, 2, 1}" ) -pad = Int32Scalar("pad_valid", 2) -s_x = Int32Scalar("stride_x", 2) -s_y = Int32Scalar("stride_y", 2) -i2 = Output("op", "TENSOR_INT32", "{1, 5, 5, 1}") -model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To(i2) - -# Example 1. Input in operand 0, -input0 = {i0: # output shape - [1, 5, 5, 1], - i1: # input 0 - [1, 2, 3, 4], - weights: # input 1 - [1, 2, 3, 4, 5, 6, 7, 8, 9]} - -output0 = {i2: # output 0 - [1, 2, 5, 4, 6, 4, 5, 14, 10, 12, 10, 14, 36, - 24, 30, 12, 15, 34, 20, 24, 21, 24, 55, 32, 36]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/transpose_conv_ex_int_3.mod.py b/tests/nnapi/specs/Ex/transpose_conv_ex_int_3.mod.py deleted file mode 100644 index e44480968..000000000 --- a/tests/nnapi/specs/Ex/transpose_conv_ex_int_3.mod.py +++ /dev/null @@ -1,27 +0,0 @@ -# model -model = Model() -i0 = Input("op_shape", "TENSOR_INT32", "{4}") -weights = Input("ker", "TENSOR_INT32", "{2, 3, 3, 1}") -i1 = Input("in", "TENSOR_INT32", "{1, 2, 2, 1}" ) -pad = Int32Scalar("pad_valid", 2) -s_x = Int32Scalar("stride_x", 2) -s_y = Int32Scalar("stride_y", 2) -i2 = Output("op", "TENSOR_INT32", "{1, 5, 5, 2}") -model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To(i2) - -# Example 1. Input in operand 0, -input0 = {i0: # output shape - [1, 5, 5, 2], - i1: # input 0 - [1, 2, 3, 4], - weights: # input 1 - [1, 3, 5, 7, 9, 11, 13, 15, 17, 2, 4, 6, 8, 10, 12, 14, 16, 18]} - -output0 = {i2: # output 0 - [1, 2, 3, 4, 7, 10, 6, 8, 10, 12, 7, 8, 9, - 10, 25, 28, 18, 20, 22, 24, 16, 20, 24, 28, 62, 72, - 42, 48, 54, 60, 21, 24, 27, 30, 61, 68, 36, 40, 44, - 48, 39, 42, 45, 48, 103, 110, 60, 64, 68, 72]} - -# Instantiate an example -Example((input0, output0)) diff --git a/tests/nnapi/specs/Ex/unpack_ex_3D_float_1.mod.py b/tests/nnapi/specs/Ex/unpack_ex_3D_float_1.mod.py index e5cb38e4b..7e8ef6086 100644 --- a/tests/nnapi/specs/Ex/unpack_ex_3D_float_1.mod.py +++ b/tests/nnapi/specs/Ex/unpack_ex_3D_float_1.mod.py @@ -1,11 +1,11 @@ # Sample UnPack model, axis = 0 model = Model() -input = Input("input", "TENSOR_FLOAT32", "{3, 2, 3, 4}") +input = Input("input", "TENSOR_FLOAT32", "{3, 6, 4}") axis = Int32Scalar("axis", 0) num_splits = Int32Scalar("num_splits", 3) -out1 = Output("output1", "TENSOR_FLOAT32", "{2, 3, 4}") -out2 = Output("output2", "TENSOR_FLOAT32", "{2, 3, 4}") -out3 = Output("output3", "TENSOR_FLOAT32", "{2, 3, 4}") +out1 = Output("output1", "TENSOR_FLOAT32", "{6, 4}") +out2 = Output("output2", "TENSOR_FLOAT32", "{6, 4}") +out3 = Output("output3", "TENSOR_FLOAT32", "{6, 4}") model = model.Operation("UNPACK_EX", input, num_splits, axis).To([out1, out2, out3]) input0 = {input: # input 0 diff --git a/tests/nnapi/specs/Ex/unpack_ex_3D_float_2.mod.py b/tests/nnapi/specs/Ex/unpack_ex_3D_float_2.mod.py index 1d1045ae9..ed7800ad4 100644 --- a/tests/nnapi/specs/Ex/unpack_ex_3D_float_2.mod.py +++ b/tests/nnapi/specs/Ex/unpack_ex_3D_float_2.mod.py @@ -1,11 +1,11 @@ -# Sample UnPack model, axis = 2 +# Sample UnPack model, axis = 1 model = Model() -input = Input("input", "TENSOR_FLOAT32", "{3, 2, 3, 4}") -axis = Int32Scalar("axis", 2) +input = Input("input", "TENSOR_FLOAT32", "{6, 3, 4}") +axis = Int32Scalar("axis", 1) num_splits = Int32Scalar("num_splits", 3) -out1 = Output("output1", "TENSOR_FLOAT32", "{3, 2, 4}") -out2 = Output("output2", "TENSOR_FLOAT32", "{3, 2, 4}") -out3 = Output("output3", "TENSOR_FLOAT32", "{3, 2, 4}") +out1 = Output("output1", "TENSOR_FLOAT32", "{6, 4}") +out2 = Output("output2", "TENSOR_FLOAT32", "{6, 4}") +out3 = Output("output3", "TENSOR_FLOAT32", "{6, 4}") model = model.Operation("UNPACK_EX", input, num_splits, axis).To([out1, out2, out3]) input0 = {input: # input 0 diff --git a/tests/nnapi/specs/Ex/unpack_ex_3D_int_1.mod.py b/tests/nnapi/specs/Ex/unpack_ex_3D_int_1.mod.py index 2a668cf7e..34e153bfc 100644 --- a/tests/nnapi/specs/Ex/unpack_ex_3D_int_1.mod.py +++ b/tests/nnapi/specs/Ex/unpack_ex_3D_int_1.mod.py @@ -1,11 +1,11 @@ # Sample UnPack model, axis = 0 model = Model() -input = Input("input", "TENSOR_INT32", "{3, 2, 3, 4}") +input = Input("input", "TENSOR_INT32", "{3, 6, 4}") axis = Int32Scalar("axis", 0) num_splits = Int32Scalar("num_splits", 3) -out1 = Output("output1", "TENSOR_INT32", "{2, 3, 4}") -out2 = Output("output2", "TENSOR_INT32", "{2, 3, 4}") -out3 = Output("output3", "TENSOR_INT32", "{2, 3, 4}") +out1 = Output("output1", "TENSOR_INT32", "{6, 4}") +out2 = Output("output2", "TENSOR_INT32", "{6, 4}") +out3 = Output("output3", "TENSOR_INT32", "{6, 4}") model = model.Operation("UNPACK_EX", input, num_splits, axis).To([out1, out2, out3]) input0 = {input: # input 0 diff --git a/tests/nnapi/specs/Ex/unpack_ex_3D_int_2.mod.py b/tests/nnapi/specs/Ex/unpack_ex_3D_int_2.mod.py index 115954972..db51351c5 100644 --- a/tests/nnapi/specs/Ex/unpack_ex_3D_int_2.mod.py +++ b/tests/nnapi/specs/Ex/unpack_ex_3D_int_2.mod.py @@ -1,11 +1,11 @@ -# Sample UnPack model, axis = 2 +# Sample UnPack model, axis = 1 model = Model() -input = Input("input", "TENSOR_INT32", "{3, 2, 3, 4}") -axis = Int32Scalar("axis", 2) +input = Input("input", "TENSOR_INT32", "{6, 3, 4}") +axis = Int32Scalar("axis", 1) num_splits = Int32Scalar("num_splits", 3) -out1 = Output("output1", "TENSOR_INT32", "{3, 2, 4}") -out2 = Output("output2", "TENSOR_INT32", "{3, 2, 4}") -out3 = Output("output3", "TENSOR_INT32", "{3, 2, 4}") +out1 = Output("output1", "TENSOR_INT32", "{6, 4}") +out2 = Output("output2", "TENSOR_INT32", "{6, 4}") +out3 = Output("output3", "TENSOR_INT32", "{6, 4}") model = model.Operation("UNPACK_EX", input, num_splits, axis).To([out1, out2, out3]) input0 = {input: # input 0 |