diff options
Diffstat (limited to 'runtimes/tests/neural_networks_test/specs/Ex')
16 files changed, 321 insertions, 0 deletions
diff --git a/runtimes/tests/neural_networks_test/specs/Ex/cast_ex_float32_to_int32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/cast_ex_float32_to_int32.mod.py new file mode 100644 index 000000000..8f94fb8ae --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/cast_ex_float32_to_int32.mod.py @@ -0,0 +1,15 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/cast_ex_int32_to_float32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/cast_ex_int32_to_float32.mod.py new file mode 100644 index 000000000..4a85dc9c5 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/cast_ex_int32_to_float32.mod.py @@ -0,0 +1,15 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_float.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_float.mod.py new file mode 100644 index 000000000..228a52ad7 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_float.mod.py @@ -0,0 +1,19 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_FLOAT32", "{4}") # a vector of 2 float32s +i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s +axis = Int32Scalar("axis", 0) +i3 = Output("op3", "TENSOR_FLOAT32", "{2}") +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/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_int32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_int32.mod.py new file mode 100644 index 000000000..36aa02937 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_int32.mod.py @@ -0,0 +1,19 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_INT32", "{4}") # a vector of 2 float32s +i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s +axis = Int32Scalar("axis", 0) +i3 = Output("op3", "TENSOR_INT32", "{2}") +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/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_quant8.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_quant8.mod.py new file mode 100644 index 000000000..7e8bfb0a7 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/gather_1D_quant8.mod.py @@ -0,0 +1,19 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{4}, 0.5f, 1") # a vector of 2 float32s +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") +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/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_float.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_float.mod.py new file mode 100644 index 000000000..5f678c643 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_float.mod.py @@ -0,0 +1,22 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}") # a vector of 2 float32s +i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s +axis = Int32Scalar("axis", 0) +i3 = Output("op3", "TENSOR_FLOAT32", "{2,4}") +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/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_int32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_int32.mod.py new file mode 100644 index 000000000..357367b26 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_int32.mod.py @@ -0,0 +1,22 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_INT32", "{3,4}") # a vector of 2 float32s +i2 = Input("op2", "TENSOR_INT32", "{2}") # another vector of 2 int32s +axis = Int32Scalar("axis", 0) +i3 = Output("op3", "TENSOR_INT32", "{2,4}") +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/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_quant8.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_quant8.mod.py new file mode 100644 index 000000000..7e07d042c --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/gather_2D_quant8.mod.py @@ -0,0 +1,22 @@ +# model +model = Model() +i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{3,4}, 0.5f, 1") # a vector of 2 float32s +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") +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/runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_float.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_float.mod.py new file mode 100644 index 000000000..6cf8d83e7 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_float.mod.py @@ -0,0 +1,18 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_int32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_int32.mod.py new file mode 100644 index 000000000..940dab3c3 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/tensorflowmax_ex_2D_int32.mod.py @@ -0,0 +1,18 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_float.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_float.mod.py new file mode 100644 index 000000000..1e0ed21d6 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_float.mod.py @@ -0,0 +1,19 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_int32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_int32.mod.py new file mode 100644 index 000000000..d2bd39adf --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_int32.mod.py @@ -0,0 +1,19 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_quant8.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_quant8.mod.py new file mode 100644 index 000000000..6f36ce41f --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_1D_quant8.mod.py @@ -0,0 +1,19 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_float.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_float.mod.py new file mode 100644 index 000000000..204bc143f --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_float.mod.py @@ -0,0 +1,25 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_int32.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_int32.mod.py new file mode 100644 index 000000000..b90a35488 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_int32.mod.py @@ -0,0 +1,25 @@ +# 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/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_quant8.mod.py b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_quant8.mod.py new file mode 100644 index 000000000..d8b5c6075 --- /dev/null +++ b/runtimes/tests/neural_networks_test/specs/Ex/topk_v2_2D_quant8.mod.py @@ -0,0 +1,25 @@ +# 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)) |