Rename reduce max operation (#4806)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 21 Mar 2019 01:25:00 +0000 (10:25 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 21 Mar 2019 01:25:00 +0000 (10:25 +0900)
Rename NNAPI Ex operation for reduce max
TENSORFLOW_MAX_EX -> REDUCE_MAX_EX
Update NeuralNetworksEx.h comment

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
15 files changed:
include/NeuralNetworksEx.h
libs/tflite/src/ext/nnapi_delegate.cpp
runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc
runtimes/pure_arm_compute/src/model.cc
tests/nnapi/nnapi_gtest.skip.armv7l-linux.neurun.cpu
tests/nnapi/nnapi_gtest.skip.x86_64-linux.neurun
tests/nnapi/specs/Ex/reduce_max_ex_2D_float.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_2D_float.mod.py with 87% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_2D_int32.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_2D_int32.mod.py with 86% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_4D_float_reducing_C.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_C.mod.py with 93% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_4D_float_reducing_HW.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_4D_float_reducing_HW.mod.py with 94% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_float.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_float.mod.py with 85% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_float_1.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_float_1.mod.py with 88% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_float_2.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_float_2.mod.py with 88% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_quant8_1.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_1.mod.py with 88% similarity]
tests/nnapi/specs/Ex/reduce_max_ex_quant8_2.mod.py [moved from tests/nnapi/specs/Ex/tensorflowmax_ex_quant8_2.mod.py with 88% similarity]

index e7194e7..2ec0f06 100644 (file)
@@ -18,7 +18,8 @@
 /**
  * @file     NeuralNetworksEx.h
  * @brief    This file contains ANeuralNetworksModel_addOperationEx function definition
- * @ingroup  COM_AI_RUNTIME
+ * @note     This header describes experimental feature,
+ *           so specification here can be changed or/and removed
  */
 #ifndef NN_RUNTIME_NEURAL_NETWORKS_EX_H
 #define NN_RUNTIME_NEURAL_NETWORKS_EX_H
@@ -141,7 +142,7 @@ typedef enum {
    * Outputs:
    * * 0: A tensor of the same {@link OperandCode} as input0.
    */
-  ANEURALNETWORKS_TENSORFLOW_MAX_EX = 50003,
+  ANEURALNETWORKS_REDUCE_MAX_EX = 50003,
 
   /**
    * Splits a tensor along a given axis into num_splits subtensors.
index 78c3fed..2aaa952 100644 (file)
@@ -821,7 +821,7 @@ TfLiteStatus AddOpsAndParams(
         continue;
       case tflite::BuiltinOperator_REDUCE_MAX:
         CHECK_NN(ANeuralNetworksModel_addOperationEx(
-            nn_model, ANEURALNETWORKS_TENSORFLOW_MAX_EX,
+            nn_model, ANEURALNETWORKS_REDUCE_MAX_EX,
             static_cast<uint32_t>(augmented_inputs.size()),
             augmented_inputs.data(),
             static_cast<uint32_t>(node.outputs->size),
@@ -936,7 +936,7 @@ TfLiteStatus AddOpsAndParams(
         std::string custom_name(registration.custom_name);
         if (custom_name.compare("TensorFlowMax") == 0) {
           CHECK_NN(ANeuralNetworksModel_addOperationEx(
-              nn_model, ANEURALNETWORKS_TENSORFLOW_MAX_EX,
+              nn_model, ANEURALNETWORKS_REDUCE_MAX_EX,
               static_cast<uint32_t>(augmented_inputs.size()),
               augmented_inputs.data(),
               static_cast<uint32_t>(node.outputs->size),
index f238927..f491198 100644 (file)
@@ -585,7 +585,7 @@ OperationFactory::OperationFactory()
     return new operation::ExpNode{inputs, outputs};
   };
 
-  _map[ANEURALNETWORKS_TENSORFLOW_MAX_EX] = [](const OperationFactory::Param &init_param) {
+  _map[ANEURALNETWORKS_REDUCE_MAX_EX] = [](const OperationFactory::Param &init_param) {
     assert(init_param.input_count == 2 && init_param.output_count == 1);
 
     operand::IndexSet outputs{init_param.outputs[0]};
index dcb8db8..ddca589 100644 (file)
@@ -763,7 +763,7 @@ int ANeuralNetworksModel_addOperationEx(ANeuralNetworksModel *model,
 
       break;
     }
-    case ANEURALNETWORKS_TENSORFLOW_MAX_EX:
+    case ANEURALNETWORKS_REDUCE_MAX_EX:
     {
       using internal::tflite::op::ReduceMax::Param;
       using internal::tflite::op::ReduceMax::Node;
index a6ce26c..3fb6ae1 100644 (file)
@@ -70,7 +70,7 @@ GeneratedTests.transpose*
 GeneratedTests.cast_ex*
 GeneratedTests.gather_ex*
 GeneratedTests.strided_slice_ex*
-GeneratedTests.tensorflowmax_ex*
+GeneratedTests.reduce_max_ex*
 GeneratedTests.reduce_sum_ex*
 GeneratedTests.topk_v2*
 # Unexpected result
index 59957ba..4eed396 100644 (file)
@@ -98,7 +98,7 @@ GeneratedTests.transpose*
 GeneratedTests.cast_ex*
 GeneratedTests.gather_ex*
 GeneratedTests.strided_slice_ex*
-GeneratedTests.tensorflowmax_ex*
+GeneratedTests.reduce_max_ex*
 GeneratedTests.reduce_sum_ex*
 GeneratedTests.topk_v2*
 # Unhandled exception
@@ -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_MAX_EX", i1, axis).To(out1)
+model = model.Operation("REDUCE_MAX_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_INT32", "{3, 4}")
 axis = Int32Scalar("axis", 1)
 out1 = Output("output", "TENSOR_INT32", "{3}")
-model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(out1)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(out1)
 
 # Example 1. Input in operand 0, 1
 input0 = {i1: # input 0
@@ -21,7 +21,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_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -21,7 +21,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_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -3,7 +3,7 @@ i1 = Input("input", "TENSOR_FLOAT32", "{1, 2, 2, 1}")
 axis = Parameter("axis", "TENSOR_INT32", "{1}", [2])
 output = Output("output", "TENSOR_FLOAT32", "{1, 2, 1}")
 
-model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -3,7 +3,7 @@ i1 = Input("input", "TENSOR_FLOAT32", "{4, 3, 2}")
 axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 0, -3, -3])
 output = Output("output", "TENSOR_FLOAT32", "{2}")
 
-model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -3,7 +3,7 @@ i1 = Input("input", "TENSOR_FLOAT32", "{4, 3, 2}")
 axis = Parameter("axis", "TENSOR_INT32", "{2}", [0, 2])
 output = Output("output", "TENSOR_FLOAT32", "{1, 3, 1}")
 
-model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -3,7 +3,7 @@ i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{4, 3, 2}, 0.8, 5")
 axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 0, -3, -3])
 output = Output("output", "TENSOR_QUANT8_ASYMM", "{2}, 0.8, 5")
 
-model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0
@@ -3,7 +3,7 @@ i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{4, 3, 2}, 0.8, 5")
 axis = Parameter("axis", "TENSOR_INT32", "{2}", [0, 2])
 output = Output("output", "TENSOR_QUANT8_ASYMM", "{1, 3, 1}, 0.8, 5")
 
-model = model.Operation("TENSORFLOW_MAX_EX", i1, axis).To(output)
+model = model.Operation("REDUCE_MAX_EX", i1, axis).To(output)
 
 # Example 1. Input in operand 0,
 input0 = {i1: # input 0