Define TOPK_V2_EX in NeuralNetworkEx.h (#3759)
authorPrasanna R/SNAP /SRI-Bangalore/Engineer/삼성전자 <prasanna.r@samsung.com>
Mon, 3 Dec 2018 03:47:07 +0000 (09:17 +0530)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Mon, 3 Dec 2018 03:47:07 +0000 (12:47 +0900)
This patch defines TOPK_V2_EX in NeuralNetworkEx.h.
Related issue: #3347

Signed-off-by: prasannar <prasanna.r@samsung.com>
include/NeuralNetworksEx.h

index 49506ce..f274082 100644 (file)
@@ -60,7 +60,32 @@ typedef enum {
      */
     ANEURALNETWORKS_CAST_EX = 50000,
     ANEURALNETWORKS_GATHER_EX = 50001,  /**< Gather slices according to indexes and axis */
-    ANEURALNETWORKS_TOPK_V2_EX = 50002, /**< Find values and indices of the k largest elements */
+
+    /**
+     * Finds values and indices of the k largest entries for the last dimension.
+     *
+     * Resulting values in each dimensions are sorted in descending order. If
+     * two values are equal, the one with larger index appears first.
+     *
+     * Supported tensor {@link OperandCode}:
+     * * {@link ANEURALNETWORKS_TENSOR_FLOAT32}
+     * * {@link ANEURALNETWORKS_TENSOR_INT32}
+     * * {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM}
+     *
+     * Supported tensor rank: from 1
+     *
+     * Inputs:
+     * * 0: input, an n-D tensor specifying the input.
+     * * 1: k, an {@link ANEURALNETWORKS_INT32} scalar, specifying the number of
+     *      top elements to look for along the last dimension.
+     *
+     * Outputs:
+     * * 0: An n-D tensor of the same type as the input, containing the k
+     *      largest elements along each last dimensional slice.
+     * * 1: An n-D tensor of type {@link ANEURALNETWORKS_TENSOR_INT32}
+     *      containing the indices of values within the last dimension of input.
+     */
+    ANEURALNETWORKS_TOPK_V2_EX = 50002,
 
     /**
      * Computes the maximum of elements across dimensions of a tensor.