This commit adds axis to runtime_run_android_nn_test.
-axis parameter is added newly.
Signed-off-by: SungJin Choi <lotieye.choi@samsung.com>
gather_1D_uint8::examples);
}
-namespace topk_v2_1D_int32 {
-std::vector<MixedTypedExample> examples = {
-// Generated topk_v2_1D_int32 test
-#include "generated/examples/topk_v2_1D_int32.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/topk_v2_1D_int32.model.cpp"
-} // namespace topk_v2_1D_int32
-TEST_F(GeneratedTests, topk_v2_1D_int32) {
- execute(topk_v2_1D_int32::CreateModel,
- topk_v2_1D_int32::is_ignored,
- topk_v2_1D_int32::examples);
-}
-
-namespace topk_v2_1D_uint8 {
-std::vector<MixedTypedExample> examples = {
-// Generated topk_v2_1D_uint8 test
-#include "generated/examples/topk_v2_1D_uint8.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/topk_v2_1D_uint8.model.cpp"
-} // namespace topk_v2_1D_uint8
-TEST_F(GeneratedTests, topk_v2_1D_uint8) {
- execute(topk_v2_1D_uint8::CreateModel,
- topk_v2_1D_uint8::is_ignored,
- topk_v2_1D_uint8::examples);
-}
-
-namespace topk_v2_2D_int32 {
-std::vector<MixedTypedExample> examples = {
-// Generated topk_v2_2D_int32 test
-#include "generated/examples/topk_v2_2D_int32.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/topk_v2_2D_int32.model.cpp"
-} // namespace topk_v2_2D_int32
-TEST_F(GeneratedTests, topk_v2_2D_int32) {
- execute(topk_v2_2D_int32::CreateModel,
- topk_v2_2D_int32::is_ignored,
- topk_v2_2D_int32::examples);
-}
-
-namespace topk_v2_2D_uint8 {
-std::vector<MixedTypedExample> examples = {
-// Generated topk_v2_2D_uint8 test
-#include "generated/examples/topk_v2_2D_uint8.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/topk_v2_2D_uint8.model.cpp"
-} // namespace topk_v2_2D_uint8
-TEST_F(GeneratedTests, topk_v2_2D_uint8) {
- execute(topk_v2_2D_uint8::CreateModel,
- topk_v2_2D_uint8::is_ignored,
- topk_v2_2D_uint8::examples);
-}
-
namespace gather_2D_float {
std::vector<MixedTypedExample> examples = {
// Generated gather_2D_float test
topk_v2_1D_float::examples);
}
+namespace topk_v2_1D_int32 {
+std::vector<MixedTypedExample> examples = {
+// Generated topk_v2_1D_int32 test
+#include "generated/examples/topk_v2_1D_int32.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/topk_v2_1D_int32.model.cpp"
+} // namespace topk_v2_1D_int32
+TEST_F(GeneratedTests, topk_v2_1D_int32) {
+ execute(topk_v2_1D_int32::CreateModel,
+ topk_v2_1D_int32::is_ignored,
+ topk_v2_1D_int32::examples);
+}
+
+namespace topk_v2_1D_uint8 {
+std::vector<MixedTypedExample> examples = {
+// Generated topk_v2_1D_uint8 test
+#include "generated/examples/topk_v2_1D_uint8.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/topk_v2_1D_uint8.model.cpp"
+} // namespace topk_v2_1D_uint8
+TEST_F(GeneratedTests, topk_v2_1D_uint8) {
+ execute(topk_v2_1D_uint8::CreateModel,
+ topk_v2_1D_uint8::is_ignored,
+ topk_v2_1D_uint8::examples);
+}
+
namespace topk_v2_2D_float {
std::vector<MixedTypedExample> examples = {
// Generated topk_v2_2D_float test
topk_v2_2D_float::is_ignored,
topk_v2_2D_float::examples);
}
+
+namespace topk_v2_2D_int32 {
+std::vector<MixedTypedExample> examples = {
+// Generated topk_v2_2D_int32 test
+#include "generated/examples/topk_v2_2D_int32.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/topk_v2_2D_int32.model.cpp"
+} // namespace topk_v2_2D_int32
+TEST_F(GeneratedTests, topk_v2_2D_int32) {
+ execute(topk_v2_2D_int32::CreateModel,
+ topk_v2_2D_int32::is_ignored,
+ topk_v2_2D_int32::examples);
+}
+
+namespace topk_v2_2D_uint8 {
+std::vector<MixedTypedExample> examples = {
+// Generated topk_v2_2D_uint8 test
+#include "generated/examples/topk_v2_2D_uint8.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/topk_v2_2D_uint8.model.cpp"
+} // namespace topk_v2_2D_uint8
+TEST_F(GeneratedTests, topk_v2_2D_uint8) {
+ execute(topk_v2_2D_uint8::CreateModel,
+ topk_v2_2D_uint8::is_ignored,
+ topk_v2_2D_uint8::examples);
+}
// Generated file (from: gather_1D_float.mod.py). Do not edit
void CreateModel(Model *model) {
- OperandType type2(Type::TENSOR_FLOAT32, {2});
+ OperandType type2(Type::INT32, {});
+ OperandType type3(Type::TENSOR_FLOAT32, {2});
OperandType type0(Type::TENSOR_FLOAT32, {4});
OperandType type1(Type::TENSOR_INT32, {2});
// Phase 1, operands
auto op1 = model->addOperand(&type0);
auto op2 = model->addOperand(&type1);
- auto op3 = model->addOperand(&type2);
+ auto axis = model->addOperand(&type2);
+ auto op3 = model->addOperand(&type3);
// Phase 2, operations
- model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2}, {op3});
+ static int32_t axis_init[] = {0};
+ model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2, axis}, {op3});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1, op2},
// Generated file (from: gather_1D_int32.mod.py). Do not edit
void CreateModel(Model *model) {
+ OperandType type2(Type::INT32, {});
OperandType type1(Type::TENSOR_INT32, {2});
OperandType type0(Type::TENSOR_INT32, {4});
// Phase 1, operands
auto op1 = model->addOperand(&type0);
auto op2 = model->addOperand(&type1);
+ auto axis = model->addOperand(&type2);
auto op3 = model->addOperand(&type1);
// Phase 2, operations
- model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2}, {op3});
+ static int32_t axis_init[] = {0};
+ model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2, axis}, {op3});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1, op2},
// Generated file (from: gather_1D_uint8.mod.py). Do not edit
void CreateModel(Model *model) {
+ OperandType type2(Type::INT32, {});
OperandType type1(Type::TENSOR_INT32, {2});
- OperandType type2(Type::TENSOR_QUANT8_ASYMM, {2});
+ OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2});
OperandType type0(Type::TENSOR_QUANT8_ASYMM, {4});
// Phase 1, operands
auto op1 = model->addOperand(&type0);
auto op2 = model->addOperand(&type1);
- auto op3 = model->addOperand(&type2);
+ auto axis = model->addOperand(&type2);
+ auto op3 = model->addOperand(&type3);
// Phase 2, operations
- model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2}, {op3});
+ static int32_t axis_init[] = {0};
+ model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2, axis}, {op3});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1, op2},
// Generated file (from: gather_2D_float.mod.py). Do not edit
void CreateModel(Model *model) {
- OperandType type2(Type::TENSOR_FLOAT32, {2,4});
+ OperandType type2(Type::INT32, {});
+ OperandType type3(Type::TENSOR_FLOAT32, {2,4});
OperandType type0(Type::TENSOR_FLOAT32, {3,4});
OperandType type1(Type::TENSOR_INT32, {2});
// Phase 1, operands
auto op1 = model->addOperand(&type0);
auto op2 = model->addOperand(&type1);
- auto op3 = model->addOperand(&type2);
+ auto axis = model->addOperand(&type2);
+ auto op3 = model->addOperand(&type3);
// Phase 2, operations
- model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2}, {op3});
+ static int32_t axis_init[] = {0};
+ model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2, axis}, {op3});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1, op2},
// Generated file (from: gather_2D_int32.mod.py). Do not edit
void CreateModel(Model *model) {
- OperandType type2(Type::TENSOR_INT32, {2,4});
+ OperandType type2(Type::INT32, {});
+ OperandType type3(Type::TENSOR_INT32, {2,4});
OperandType type1(Type::TENSOR_INT32, {2});
OperandType type0(Type::TENSOR_INT32, {3,4});
// Phase 1, operands
auto op1 = model->addOperand(&type0);
auto op2 = model->addOperand(&type1);
- auto op3 = model->addOperand(&type2);
+ auto axis = model->addOperand(&type2);
+ auto op3 = model->addOperand(&type3);
// Phase 2, operations
- model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2}, {op3});
+ static int32_t axis_init[] = {0};
+ model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2, axis}, {op3});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1, op2},
// Generated file (from: gather_2D_uint8.mod.py). Do not edit
void CreateModel(Model *model) {
+ OperandType type2(Type::INT32, {});
OperandType type1(Type::TENSOR_INT32, {2});
- OperandType type2(Type::TENSOR_QUANT8_ASYMM, {2,4});
+ OperandType type3(Type::TENSOR_QUANT8_ASYMM, {2,4});
OperandType type0(Type::TENSOR_QUANT8_ASYMM, {3,4});
// Phase 1, operands
auto op1 = model->addOperand(&type0);
auto op2 = model->addOperand(&type1);
- auto op3 = model->addOperand(&type2);
+ auto axis = model->addOperand(&type2);
+ auto op3 = model->addOperand(&type3);
// Phase 2, operations
- model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2}, {op3});
+ static int32_t axis_init[] = {0};
+ model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
+ model->addOperationEx(ANEURALNETWORKS_GATHER_EX, {op1, op2, axis}, {op3});
// Phase 3, inputs and outputs
model->identifyInputsAndOutputs(
{op1, op2},
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).To(i3)
+model = model.Operation("GATHER_EX", i1, i2, axis).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
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).To(i3)
+model = model.Operation("GATHER_EX", i1, i2, axis).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
model = Model()
i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{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_QUANT8_ASYMM", "{2}")
-model = model.Operation("GATHER_EX", i1, i2).To(i3)
+model = model.Operation("GATHER_EX", i1, i2, axis).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
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).To(i3)
+model = model.Operation("GATHER_EX", i1, i2, axis).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
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).To(i3)
+model = model.Operation("GATHER_EX", i1, i2, axis).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
model = Model()
i1 = Input("op1", "TENSOR_QUANT8_ASYMM", "{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_QUANT8_ASYMM", "{2,4}")
-model = model.Operation("GATHER_EX", i1, i2).To(i3)
+model = model.Operation("GATHER_EX", i1, i2, axis).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0