Changes in PACK GTest as per specifications in NNAPI (#3866)
authorPrasanna R/SNAP /SRI-Bangalore/Engineer/삼성전자 <prasanna.r@samsung.com>
Wed, 5 Dec 2018 06:08:02 +0000 (11:38 +0530)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 5 Dec 2018 06:08:02 +0000 (15:08 +0900)
This patch makes changes in PACK GTests as per specification in NNAPI.
Refer #3864 for specification.

Signed-off-by: prasannar <prasanna.r@samsung.com>
runtimes/tests/neural_networks_test/generated/models/pack_ex_3D_float.model.cpp
runtimes/tests/neural_networks_test/generated/models/pack_ex_3D_float2.model.cpp
runtimes/tests/neural_networks_test/specs/Ex/pack_ex_3D_float.mod.py
runtimes/tests/neural_networks_test/specs/Ex/pack_ex_3D_float2.mod.py

index afc71cd..521b5cd 100644 (file)
@@ -7,12 +7,15 @@ void CreateModel(Model *model) {
   auto input1 = model->addOperand(&type0);
   auto input2 = model->addOperand(&type0);
   auto input3 = model->addOperand(&type0);
+  auto num = model->addOperand(&type1);
   auto axis = model->addOperand(&type1);
   auto output = model->addOperand(&type2);
   // Phase 2, operations
+  static int32_t num_init[] = {3};
+  model->setOperandValue(num, num_init, sizeof(int32_t) * 1);
   static int32_t axis_init[] = {0};
   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
-  model->addOperationEx(ANEURALNETWORKS_PACK_EX, {input1, input2, input3, axis}, {output});
+  model->addOperationEx(ANEURALNETWORKS_PACK_EX, {input1, input2, input3, num, axis}, {output});
   // Phase 3, inputs and outputs
   model->identifyInputsAndOutputs(
     {input1, input2, input3},
index 0ec1d60..67dd00a 100644 (file)
@@ -7,12 +7,15 @@ void CreateModel(Model *model) {
   auto input1 = model->addOperand(&type0);
   auto input2 = model->addOperand(&type0);
   auto input3 = model->addOperand(&type0);
+  auto num = model->addOperand(&type1);
   auto axis = model->addOperand(&type1);
   auto output = model->addOperand(&type2);
   // Phase 2, operations
+  static int32_t num_init[] = {3};
+  model->setOperandValue(num, num_init, sizeof(int32_t) * 1);
   static int32_t axis_init[] = {2};
   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
-  model->addOperationEx(ANEURALNETWORKS_PACK_EX, {input1, input2, input3, axis}, {output});
+  model->addOperationEx(ANEURALNETWORKS_PACK_EX, {input1, input2, input3, num, axis}, {output});
   // Phase 3, inputs and outputs
   model->identifyInputsAndOutputs(
     {input1, input2, input3},
index c9a94b0..f9dd1e8 100644 (file)
@@ -3,9 +3,10 @@ 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}")
+num = Int32Scalar("num", 3)
 axis = Int32Scalar("axis", 0)
 out = Output("output", "TENSOR_FLOAT32", "{3, 2, 3, 4}")
-model = model.Operation("PACK_EX", i1, i2, i3, axis).To(out)
+model = model.Operation("PACK_EX", i1, i2, i3, num, axis).To(out)
 
 input0 = {i1: # input 0
          [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
index b150e3e..7d83cd8 100644 (file)
@@ -3,9 +3,10 @@ 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}")
+num = Int32Scalar("num", 3)
 axis = Int32Scalar("axis", 2)
 out = Output("output", "TENSOR_FLOAT32", "{2, 3, 3, 4}")
-model = model.Operation("PACK_EX", i1, i2, i3, axis).To(out)
+model = model.Operation("PACK_EX", i1, i2, i3, num, axis).To(out)
 
 input0 = {i1: # input 0
          [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],