Change operator TENSORFLOW_SUM name (#3747)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 5 Dec 2018 03:08:23 +0000 (12:08 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 5 Dec 2018 03:08:23 +0000 (12:08 +0900)
Change operator ANEURALNETWORKS_TENSORFLOW_SUM_EX name to ANEURALNETWORKS_REDUCE_SUM_EX

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
19 files changed:
include/NeuralNetworksEx.h
libs/support/tflite/src/nnapi_delegate.cpp
runtimes/pure_arm_compute/src/model.cc
runtimes/tests/neural_networks_test/generated/all_generated_tests.cpp
runtimes/tests/neural_networks_test/generated/examples/reduce_sum_ex_2D_float.example.cpp [moved from runtimes/tests/neural_networks_test/generated/examples/tensorflowsum_ex_2D_float.example.cpp with 87% similarity]
runtimes/tests/neural_networks_test/generated/examples/reduce_sum_ex_4D_float.example.cpp [moved from runtimes/tests/neural_networks_test/generated/examples/tensorflowsum_ex_4D_float.example.cpp with 87% similarity]
runtimes/tests/neural_networks_test/generated/examples/reduce_sum_ex_4D_float_reducing_C.example.cpp [moved from runtimes/tests/neural_networks_test/generated/examples/tensorflowsum_ex_4D_float_reducing_C.example.cpp with 92% similarity]
runtimes/tests/neural_networks_test/generated/examples/reduce_sum_ex_4D_float_reducing_HW.example.cpp [moved from runtimes/tests/neural_networks_test/generated/examples/tensorflowsum_ex_4D_float_reducing_HW.example.cpp with 91% similarity]
runtimes/tests/neural_networks_test/generated/models/reduce_sum_ex_2D_float.model.cpp [moved from runtimes/tests/neural_networks_test/generated/models/tensorflowsum_ex_2D_float.model.cpp with 81% similarity]
runtimes/tests/neural_networks_test/generated/models/reduce_sum_ex_4D_float.model.cpp [moved from runtimes/tests/neural_networks_test/generated/models/tensorflowsum_ex_4D_float.model.cpp with 81% similarity]
runtimes/tests/neural_networks_test/generated/models/reduce_sum_ex_4D_float_reducing_C.model.cpp [moved from runtimes/tests/neural_networks_test/generated/models/tensorflowsum_ex_4D_float_reducing_C.model.cpp with 80% similarity]
runtimes/tests/neural_networks_test/generated/models/reduce_sum_ex_4D_float_reducing_HW.model.cpp [moved from runtimes/tests/neural_networks_test/generated/models/tensorflowsum_ex_4D_float_reducing_HW.model.cpp with 80% similarity]
runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux.neurun
runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-tizen
runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.x86_64-linux
runtimes/tests/neural_networks_test/specs/Ex/reduce_sum_ex_2D_float.mod.py [moved from runtimes/tests/neural_networks_test/specs/Ex/tensorflowsum_ex_2D_float.mod.py with 87% similarity]
runtimes/tests/neural_networks_test/specs/Ex/reduce_sum_ex_4D_float.mod.py [moved from runtimes/tests/neural_networks_test/specs/Ex/tensorflowsum_ex_4D_float.mod.py with 87% similarity]
runtimes/tests/neural_networks_test/specs/Ex/reduce_sum_ex_4D_float_reducing_C.mod.py [moved from runtimes/tests/neural_networks_test/specs/Ex/tensorflowsum_ex_4D_float_reducing_C.mod.py with 93% similarity]
runtimes/tests/neural_networks_test/specs/Ex/reduce_sum_ex_4D_float_reducing_HW.mod.py [moved from runtimes/tests/neural_networks_test/specs/Ex/tensorflowsum_ex_4D_float_reducing_HW.mod.py with 93% similarity]

index 3785b85..a877b83 100644 (file)
@@ -271,18 +271,18 @@ typedef enum {
      * Outputs:
      * * 0: A tensor of the same {@link OperandCode} as input0.
      */
-    ANEURALNETWORKS_TENSORFLOW_SUM_EX = 50009,
+    ANEURALNETWORKS_REDUCE_SUM_EX = 50009,
 
     /**
      * A transposed convolutional layer carries out a regular convolution but reverts its spatisal transformation.
      * Transpose convolution basically performs convolution with transposed weights.
-     * 
+     *
      * Supported tensor {@link OperandCode}:
      * {@link ANEURALNETWORKS_TENSOR_FLOAT32}
      * {@link ANEURALNETWORKS_TENSOR_INT32}
-     * 
+     *
      * Supported tensor rank: only 4
-     * 
+     *
      * Inputs:
      *   0: An {@link ANEURALNETWORKS_INT32} 1-D four element tensor, specifying the output shape.
      *   1: A 4-D tensor, of shape [depth_out, filter_height, filter_width, depth_in], specifying the filter.
@@ -292,7 +292,7 @@ typedef enum {
      *      walking through input in the ‘width’ dimension.
      *   5: An {@link ANEURALNETWORKS_INT32} scalar, specifying the stride when
      *      walking through input in the height dimension.
-     * 
+     *
      * Outputs:
      *   0: The output 4-D tensor, of shape [batches, out_height, out_width, depth_out].
      */
@@ -395,7 +395,7 @@ typedef enum {
      *      number of splits along unpack axis.
      * Outputs:
      * * 0 ~ n-1: The list of n output tensors, of shape
-     *            [D0, D1, ..., Daxis(i), ..., Dm]. The output tensors are of the same 
+     *            [D0, D1, ..., Daxis(i), ..., Dm]. The output tensors are of the same
      *            {@link OperandCode} as the input tensor 0.
      */
     ANEURALNETWORKS_UNPACK_EX = 50014,
index f706770..123787b 100644 (file)
@@ -808,7 +808,7 @@ TfLiteStatus AddOpsAndParams(
         continue;
       case tflite::BuiltinOperator_SUM:
         CHECK_NN(ANeuralNetworksModel_addOperationEx(
-            nn_model, ANEURALNETWORKS_TENSORFLOW_SUM_EX,
+            nn_model, ANEURALNETWORKS_REDUCE_SUM_EX,
             static_cast<uint32_t>(augmented_inputs.size()),
             augmented_inputs.data(),
             static_cast<uint32_t>(node.outputs->size),
@@ -923,7 +923,7 @@ TfLiteStatus AddOpsAndParams(
         }
         else if (custom_name.compare("TensorFlowSum") == 0) {
           CHECK_NN(ANeuralNetworksModel_addOperationEx(
-              nn_model, ANEURALNETWORKS_TENSORFLOW_SUM_EX,
+              nn_model, ANEURALNETWORKS_REDUCE_SUM_EX,
               static_cast<uint32_t>(augmented_inputs.size()),
               augmented_inputs.data(),
               static_cast<uint32_t>(node.outputs->size),
index a144b26..2c4120d 100644 (file)
@@ -941,7 +941,7 @@ int ANeuralNetworksModel_addOperationEx(ANeuralNetworksModel *model,
 
       break;
     }
-    case ANEURALNETWORKS_TENSORFLOW_SUM_EX:
+    case ANEURALNETWORKS_REDUCE_SUM_EX:
     {
       using internal::tflite::op::ReduceSum::Param;
       using internal::tflite::op::ReduceSum::Node;
index 440610d..783e104 100644 (file)
@@ -3571,6 +3571,62 @@ TEST_F(GeneratedTests, reduce_min_ex) {
             reduce_min_ex::examples);
 }
 
+namespace reduce_sum_ex_2D_float {
+std::vector<MixedTypedExample> examples = {
+// Generated reduce_sum_ex_2D_float test
+#include "generated/examples/reduce_sum_ex_2D_float.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/reduce_sum_ex_2D_float.model.cpp"
+} // namespace reduce_sum_ex_2D_float
+TEST_F(GeneratedTests, reduce_sum_ex_2D_float) {
+    execute(reduce_sum_ex_2D_float::CreateModel,
+            reduce_sum_ex_2D_float::is_ignored,
+            reduce_sum_ex_2D_float::examples);
+}
+
+namespace reduce_sum_ex_4D_float {
+std::vector<MixedTypedExample> examples = {
+// Generated reduce_sum_ex_4D_float test
+#include "generated/examples/reduce_sum_ex_4D_float.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/reduce_sum_ex_4D_float.model.cpp"
+} // namespace reduce_sum_ex_4D_float
+TEST_F(GeneratedTests, reduce_sum_ex_4D_float) {
+    execute(reduce_sum_ex_4D_float::CreateModel,
+            reduce_sum_ex_4D_float::is_ignored,
+            reduce_sum_ex_4D_float::examples);
+}
+
+namespace reduce_sum_ex_4D_float_reducing_C {
+std::vector<MixedTypedExample> examples = {
+// Generated reduce_sum_ex_4D_float_reducing_C test
+#include "generated/examples/reduce_sum_ex_4D_float_reducing_C.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/reduce_sum_ex_4D_float_reducing_C.model.cpp"
+} // namespace reduce_sum_ex_4D_float_reducing_C
+TEST_F(GeneratedTests, reduce_sum_ex_4D_float_reducing_C) {
+    execute(reduce_sum_ex_4D_float_reducing_C::CreateModel,
+            reduce_sum_ex_4D_float_reducing_C::is_ignored,
+            reduce_sum_ex_4D_float_reducing_C::examples);
+}
+
+namespace reduce_sum_ex_4D_float_reducing_HW {
+std::vector<MixedTypedExample> examples = {
+// Generated reduce_sum_ex_4D_float_reducing_HW test
+#include "generated/examples/reduce_sum_ex_4D_float_reducing_HW.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/reduce_sum_ex_4D_float_reducing_HW.model.cpp"
+} // namespace reduce_sum_ex_4D_float_reducing_HW
+TEST_F(GeneratedTests, reduce_sum_ex_4D_float_reducing_HW) {
+    execute(reduce_sum_ex_4D_float_reducing_HW::CreateModel,
+            reduce_sum_ex_4D_float_reducing_HW::is_ignored,
+            reduce_sum_ex_4D_float_reducing_HW::examples);
+}
+
 namespace rsqrt_ex_float_1 {
 std::vector<MixedTypedExample> examples = {
 // Generated rsqrt_ex_float_1 test
@@ -3865,62 +3921,6 @@ TEST_F(GeneratedTests, tensorflowmax_ex_quant8_2) {
             tensorflowmax_ex_quant8_2::examples);
 }
 
-namespace tensorflowsum_ex_2D_float {
-std::vector<MixedTypedExample> examples = {
-// Generated tensorflowsum_ex_2D_float test
-#include "generated/examples/tensorflowsum_ex_2D_float.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/tensorflowsum_ex_2D_float.model.cpp"
-} // namespace tensorflowsum_ex_2D_float
-TEST_F(GeneratedTests, tensorflowsum_ex_2D_float) {
-    execute(tensorflowsum_ex_2D_float::CreateModel,
-            tensorflowsum_ex_2D_float::is_ignored,
-            tensorflowsum_ex_2D_float::examples);
-}
-
-namespace tensorflowsum_ex_4D_float {
-std::vector<MixedTypedExample> examples = {
-// Generated tensorflowsum_ex_4D_float test
-#include "generated/examples/tensorflowsum_ex_4D_float.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/tensorflowsum_ex_4D_float.model.cpp"
-} // namespace tensorflowsum_ex_4D_float
-TEST_F(GeneratedTests, tensorflowsum_ex_4D_float) {
-    execute(tensorflowsum_ex_4D_float::CreateModel,
-            tensorflowsum_ex_4D_float::is_ignored,
-            tensorflowsum_ex_4D_float::examples);
-}
-
-namespace tensorflowsum_ex_4D_float_reducing_C {
-std::vector<MixedTypedExample> examples = {
-// Generated tensorflowsum_ex_4D_float_reducing_C test
-#include "generated/examples/tensorflowsum_ex_4D_float_reducing_C.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/tensorflowsum_ex_4D_float_reducing_C.model.cpp"
-} // namespace tensorflowsum_ex_4D_float_reducing_C
-TEST_F(GeneratedTests, tensorflowsum_ex_4D_float_reducing_C) {
-    execute(tensorflowsum_ex_4D_float_reducing_C::CreateModel,
-            tensorflowsum_ex_4D_float_reducing_C::is_ignored,
-            tensorflowsum_ex_4D_float_reducing_C::examples);
-}
-
-namespace tensorflowsum_ex_4D_float_reducing_HW {
-std::vector<MixedTypedExample> examples = {
-// Generated tensorflowsum_ex_4D_float_reducing_HW test
-#include "generated/examples/tensorflowsum_ex_4D_float_reducing_HW.example.cpp"
-};
-// Generated model constructor
-#include "generated/models/tensorflowsum_ex_4D_float_reducing_HW.model.cpp"
-} // namespace tensorflowsum_ex_4D_float_reducing_HW
-TEST_F(GeneratedTests, tensorflowsum_ex_4D_float_reducing_HW) {
-    execute(tensorflowsum_ex_4D_float_reducing_HW::CreateModel,
-            tensorflowsum_ex_4D_float_reducing_HW::is_ignored,
-            tensorflowsum_ex_4D_float_reducing_HW::examples);
-}
-
 namespace topk_v2_ex_1D_float {
 std::vector<MixedTypedExample> examples = {
 // Generated topk_v2_ex_1D_float test
@@ -1,4 +1,4 @@
-// Generated file (from: tensorflowsum_ex_2D_float.mod.py). Do not edit
+// Generated file (from: reduce_sum_ex_2D_float.mod.py). Do not edit
 void CreateModel(Model *model) {
   OperandType type1(Type::INT32, {});
   OperandType type0(Type::TENSOR_FLOAT32, {3, 4});
@@ -10,7 +10,7 @@ void CreateModel(Model *model) {
   // Phase 2, operations
   static int32_t axis_init[] = {1};
   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
-  model->addOperationEx(ANEURALNETWORKS_TENSORFLOW_SUM_EX, {input, axis}, {output});
+  model->addOperationEx(ANEURALNETWORKS_REDUCE_SUM_EX, {input, axis}, {output});
   // Phase 3, inputs and outputs
   model->identifyInputsAndOutputs(
     {input},
@@ -1,4 +1,4 @@
-// Generated file (from: tensorflowsum_ex_4D_float.mod.py). Do not edit
+// Generated file (from: reduce_sum_ex_4D_float.mod.py). Do not edit
 void CreateModel(Model *model) {
   OperandType type1(Type::INT32, {});
   OperandType type0(Type::TENSOR_FLOAT32, {1, 3, 4, 1});
@@ -10,7 +10,7 @@ void CreateModel(Model *model) {
   // Phase 2, operations
   static int32_t axis_init[] = {1};
   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 1);
-  model->addOperationEx(ANEURALNETWORKS_TENSORFLOW_SUM_EX, {input, axis}, {output});
+  model->addOperationEx(ANEURALNETWORKS_REDUCE_SUM_EX, {input, axis}, {output});
   // Phase 3, inputs and outputs
   model->identifyInputsAndOutputs(
     {input},
@@ -1,4 +1,4 @@
-// Generated file (from: tensorflowsum_ex_4D_float_reducing_C.mod.py). Do not edit
+// Generated file (from: reduce_sum_ex_4D_float_reducing_C.mod.py). Do not edit
 void CreateModel(Model *model) {
   OperandType type0(Type::TENSOR_FLOAT32, {2, 3, 4, 5});
   OperandType type2(Type::TENSOR_FLOAT32, {2, 3, 4});
@@ -10,7 +10,7 @@ void CreateModel(Model *model) {
   // Phase 2, operations
   static int32_t axis_init[] = {3, -1};
   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 2);
-  model->addOperationEx(ANEURALNETWORKS_TENSORFLOW_SUM_EX, {input, axis}, {output});
+  model->addOperationEx(ANEURALNETWORKS_REDUCE_SUM_EX, {input, axis}, {output});
   // Phase 3, inputs and outputs
   model->identifyInputsAndOutputs(
     {input},
@@ -1,4 +1,4 @@
-// Generated file (from: tensorflowsum_ex_4D_float_reducing_HW.mod.py). Do not edit
+// Generated file (from: reduce_sum_ex_4D_float_reducing_HW.mod.py). Do not edit
 void CreateModel(Model *model) {
   OperandType type0(Type::TENSOR_FLOAT32, {2, 3, 4, 5});
   OperandType type2(Type::TENSOR_FLOAT32, {2, 5});
@@ -10,7 +10,7 @@ void CreateModel(Model *model) {
   // Phase 2, operations
   static int32_t axis_init[] = {1, 2, -3, -2};
   model->setOperandValue(axis, axis_init, sizeof(int32_t) * 4);
-  model->addOperationEx(ANEURALNETWORKS_TENSORFLOW_SUM_EX, {input, axis}, {output});
+  model->addOperationEx(ANEURALNETWORKS_REDUCE_SUM_EX, {input, axis}, {output});
   // Phase 3, inputs and outputs
   model->identifyInputsAndOutputs(
     {input},
index 9b5c359..0b6def0 100644 (file)
@@ -104,7 +104,7 @@ GeneratedTests.cast_ex*
 GeneratedTests.gather_ex*
 GeneratedTests.strided_slice_ex*
 GeneratedTests.tensorflowmax_ex*
-GeneratedTests.tensorflowsum_ex*
+GeneratedTests.reduce_sum_ex*
 GeneratedTests.topk_v2*
 # Unhandled exception
 GeneratedTests.concat*
index e068f44..9f26f75 100644 (file)
@@ -76,8 +76,8 @@ GeneratedTests.tensorflowmax_ex_float_1
 GeneratedTests.tensorflowmax_ex_float_2
 GeneratedTests.tensorflowmax_ex_quant8_1
 GeneratedTests.tensorflowmax_ex_quant8_2
-GeneratedTests.tensorflowsum_ex_2D_float
-GeneratedTests.tensorflowsum_ex_4D_float
+GeneratedTests.reduce_sum_ex_2D_float
+GeneratedTests.reduce_sum_ex_4D_float
 GeneratedTests.transpose
 GeneratedTests.transpose_float_1
 GeneratedTests.transpose_quant8_1
index ab29975..98fa20e 100644 (file)
@@ -70,7 +70,7 @@ GeneratedTests.strided_slice_float_8
 GeneratedTests.strided_slice_float_9
 GeneratedTests.strided_slice
 GeneratedTests.tensorflowmax_ex*
-GeneratedTests.tensorflowsum_ex*
+GeneratedTests.reduce_sum_ex*
 GeneratedTests.sub_broadcast_float
 TrivialTest.*
 ValidationTest.*
@@ -3,7 +3,7 @@ model = Model()
 i1 = Input("input", "TENSOR_FLOAT32", "{3, 4}")
 axis = Int32Scalar("axis", 1)
 out1 = Output("output", "TENSOR_FLOAT32", "{3}")
-model = model.Operation("TENSORFLOW_SUM_EX", i1, axis).To(out1)
+model = model.Operation("REDUCE_SUM_EX", i1, axis).To(out1)
 
 # Example 1. Input in operand 0, 1
 input0 = {i1: # input 0
@@ -3,7 +3,7 @@ model = Model()
 i1 = Input("input", "TENSOR_FLOAT32", "{1, 3, 4, 1}")
 axis = Int32Scalar("axis", 1)
 out1 = Output("output", "TENSOR_FLOAT32", "{1, 4, 1}")
-model = model.Operation("TENSORFLOW_SUM_EX", i1, axis).To(out1)
+model = model.Operation("REDUCE_SUM_EX", i1, axis).To(out1)
 
 # Example 1. Input in operand 0, 1
 input0 = {i1: # input 0
@@ -19,7 +19,7 @@ i1 = Input("input", "TENSOR_FLOAT32", "{%d, %d, %d, %d}" % (batch, rows, cols, d
 axis = Parameter("axis", "TENSOR_INT32", "{2}", [3, -1])
 output = Output("output", "TENSOR_FLOAT32", "{%d, %d, %d}" % (batch, rows, cols))
 
-model = model.Operation("TENSORFLOW_SUM_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_SUM_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -19,7 +19,7 @@ i1 = Input("input", "TENSOR_FLOAT32", "{%d, %d, %d, %d}" % (batch, rows, cols, d
 axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 2, -3, -2])
 output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (batch, depth))
 
-model = model.Operation("TENSORFLOW_SUM_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_SUM_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0