This patch adds generatedtests for TransposeConv.
Signed-off-by: b.devansh <b.devansh@samsung.com>
topk_v2_ex_2D_quant8::examples);
}
+namespace transpose_conv_ex_float_1 {
+std::vector<MixedTypedExample> examples = {
+// Generated transpose_conv_ex_float_1 test
+#include "generated/examples/transpose_conv_ex_float_1.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/transpose_conv_ex_float_1.model.cpp"
+} // namespace transpose_conv_ex_float_1
+TEST_F(GeneratedTests, transpose_conv_ex_float_1) {
+ execute(transpose_conv_ex_float_1::CreateModel,
+ transpose_conv_ex_float_1::is_ignored,
+ transpose_conv_ex_float_1::examples);
+}
+
+namespace transpose_conv_ex_float_2 {
+std::vector<MixedTypedExample> examples = {
+// Generated transpose_conv_ex_float_2 test
+#include "generated/examples/transpose_conv_ex_float_2.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/transpose_conv_ex_float_2.model.cpp"
+} // namespace transpose_conv_ex_float_2
+TEST_F(GeneratedTests, transpose_conv_ex_float_2) {
+ execute(transpose_conv_ex_float_2::CreateModel,
+ transpose_conv_ex_float_2::is_ignored,
+ transpose_conv_ex_float_2::examples);
+}
+
+namespace transpose_conv_ex_float_3 {
+std::vector<MixedTypedExample> examples = {
+// Generated transpose_conv_ex_float_3 test
+#include "generated/examples/transpose_conv_ex_float_3.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/transpose_conv_ex_float_3.model.cpp"
+} // namespace transpose_conv_ex_float_3
+TEST_F(GeneratedTests, transpose_conv_ex_float_3) {
+ execute(transpose_conv_ex_float_3::CreateModel,
+ transpose_conv_ex_float_3::is_ignored,
+ transpose_conv_ex_float_3::examples);
+}
+
namespace unpack_ex_3D_float2 {
std::vector<MixedTypedExample> examples = {
// Generated unpack_ex_3D_float2 test
--- /dev/null
+// Generated file (from: transpose_conv_ex_float_1.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1, 4, 4, 1}}, {1, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, {2, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {29, 62, 83, 75, 99, 192, 237, 198, 207, 372, 417, 330, 263, 446, 485, 365}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: transpose_conv_ex_float_2.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1, 5, 5, 1}}, {1, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, {2, {1, 2, 3, 4}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{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}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: transpose_conv_ex_float_3.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1, 5, 5, 2}}, {1, {1, 3, 5, 7, 9, 11, 13, 15, 17, 2, 4, 6, 8, 10, 12, 14, 16, 18}}, {2, {1, 2, 3, 4}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{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}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
--- /dev/null
+// Generated file (from: transpose_conv_ex_float_1.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type3(Type::INT32, {});
+ OperandType type1(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
+ OperandType type2(Type::TENSOR_FLOAT32, {1, 4, 4, 1});
+ OperandType type0(Type::TENSOR_FLOAT32, {4});
+ // Phase 1, operands
+ auto op_shape = model->addOperand(&type0);
+ auto ker = model->addOperand(&type1);
+ auto in = model->addOperand(&type2);
+ auto pad_same = model->addOperand(&type3);
+ auto stride_x = model->addOperand(&type3);
+ auto stride_y = model->addOperand(&type3);
+ auto op = model->addOperand(&type2);
+ // Phase 2, operations
+ static int32_t pad_same_init[] = {1};
+ model->setOperandValue(pad_same, pad_same_init, sizeof(int32_t) * 1);
+ static int32_t stride_x_init[] = {1};
+ model->setOperandValue(stride_x, stride_x_init, sizeof(int32_t) * 1);
+ static int32_t stride_y_init[] = {1};
+ model->setOperandValue(stride_y, stride_y_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_TRANSPOSE_CONV_EX, {op_shape, ker, in, pad_same, stride_x, stride_y}, {op});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op_shape, ker, in},
+ {op});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
--- /dev/null
+// Generated file (from: transpose_conv_ex_float_2.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type3(Type::INT32, {});
+ OperandType type2(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
+ OperandType type1(Type::TENSOR_FLOAT32, {1, 3, 3, 1});
+ OperandType type4(Type::TENSOR_FLOAT32, {1, 5, 5, 1});
+ OperandType type0(Type::TENSOR_FLOAT32, {4});
+ // Phase 1, operands
+ auto op_shape = model->addOperand(&type0);
+ auto ker = model->addOperand(&type1);
+ auto in = model->addOperand(&type2);
+ auto pad_valid = model->addOperand(&type3);
+ auto stride_x = model->addOperand(&type3);
+ auto stride_y = model->addOperand(&type3);
+ auto op = model->addOperand(&type4);
+ // Phase 2, operations
+ static int32_t pad_valid_init[] = {2};
+ model->setOperandValue(pad_valid, pad_valid_init, sizeof(int32_t) * 1);
+ static int32_t stride_x_init[] = {2};
+ model->setOperandValue(stride_x, stride_x_init, sizeof(int32_t) * 1);
+ static int32_t stride_y_init[] = {2};
+ model->setOperandValue(stride_y, stride_y_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_TRANSPOSE_CONV_EX, {op_shape, ker, in, pad_valid, stride_x, stride_y}, {op});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op_shape, ker, in},
+ {op});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
--- /dev/null
+// Generated file (from: transpose_conv_ex_float_3.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type3(Type::INT32, {});
+ OperandType type2(Type::TENSOR_FLOAT32, {1, 2, 2, 1});
+ OperandType type4(Type::TENSOR_FLOAT32, {1, 5, 5, 2});
+ OperandType type1(Type::TENSOR_FLOAT32, {2, 3, 3, 1});
+ OperandType type0(Type::TENSOR_FLOAT32, {4});
+ // Phase 1, operands
+ auto op_shape = model->addOperand(&type0);
+ auto ker = model->addOperand(&type1);
+ auto in = model->addOperand(&type2);
+ auto pad_valid = model->addOperand(&type3);
+ auto stride_x = model->addOperand(&type3);
+ auto stride_y = model->addOperand(&type3);
+ auto op = model->addOperand(&type4);
+ // Phase 2, operations
+ static int32_t pad_valid_init[] = {2};
+ model->setOperandValue(pad_valid, pad_valid_init, sizeof(int32_t) * 1);
+ static int32_t stride_x_init[] = {2};
+ model->setOperandValue(stride_x, stride_x_init, sizeof(int32_t) * 1);
+ static int32_t stride_y_init[] = {2};
+ model->setOperandValue(stride_y, stride_y_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_TRANSPOSE_CONV_EX, {op_shape, ker, in, pad_valid, stride_x, stride_y}, {op});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {op_shape, ker, in},
+ {op});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
GeneratedTests.max_pool_quant8_4
GeneratedTests.softmax*
GeneratedTests.split*
+GeneratedTests.transpose_conv*
GeneratedTests.pack*
GeneratedTests.unpack*
GeneratedTests.mul_broadcast_quant8
GeneratedTests.mul_quant8
GeneratedTests.split*
+GeneratedTests.transpose_conv*
GeneratedTests.sub_broadcast_float
GeneratedTests.pack_ex_3D_float2
GeneratedTests.gather_ex_1D_quant8
GeneratedTests.gather_ex_2D_quant8
GeneratedTests.split*
+GeneratedTests.transpose_conv*
GeneratedTests.pack*
GeneratedTests.unpack*
--- /dev/null
+# model
+model = Model()
+i0 = Input("op_shape", "TENSOR_FLOAT32", "{4}")
+weights = Input("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}")
+i1 = Input("in", "TENSOR_FLOAT32", "{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_FLOAT32", "{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))
--- /dev/null
+# model
+model = Model()
+i0 = Input("op_shape", "TENSOR_FLOAT32", "{4}")
+weights = Input("ker", "TENSOR_FLOAT32", "{1, 3, 3, 1}")
+i1 = Input("in", "TENSOR_FLOAT32", "{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_FLOAT32", "{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))
--- /dev/null
+# model
+model = Model()
+i0 = Input("op_shape", "TENSOR_FLOAT32", "{4}")
+weights = Input("ker", "TENSOR_FLOAT32", "{2, 3, 3, 1}")
+i1 = Input("in", "TENSOR_FLOAT32", "{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_FLOAT32", "{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))