From 5548159db70dbc52545d3426af901d2c7ad57fba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Prasanna=20R/SNAP=20/SRI-Bangalore/Engineer/=EC=82=BC?= =?utf8?q?=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 3 Dec 2018 07:39:37 +0530 Subject: [PATCH] Introduce PRELU_EX in NeuralNetworksEx.h (#3769) This patch introduces PRELU_EX in NeuralNetworksEx.h Related issue: #3574 #3459 Signed-off-by: prasannar --- include/NeuralNetworksEx.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/NeuralNetworksEx.h b/include/NeuralNetworksEx.h index 2c8fd9d..49506ce 100644 --- a/include/NeuralNetworksEx.h +++ b/include/NeuralNetworksEx.h @@ -510,6 +510,42 @@ typedef enum { * * 0: A tensor of the same {@link OperandCode} as input0. */ ANEURALNETWORKS_REDUCE_MIN_EX = 500021, + + /** + * Parametric Rectified Linear Unit. + * + * It follows: f(x) = alpha * x for x < 0, f(x) = x for x >= 0, where alpha + * is a learned array with the same {@link OperandCode} and compatible + * dimensions as input x. + * + * Two dimensions are compatible when: + * 1. they are equal, or + * 2. one of them is 1 + * + * The size of the output is the maximum size along each dimension of the + * input operands. It starts with the trailing dimensions, and works its way + * forward. + * + * Example: + * input.dimension = {4, 1, 2} + * alpha.dimension = {5, 4, 3, 1} + * output.dimension = {5, 4, 3, 2} + * + * Supported tensor {@link OperandCode}: + * * {@link ANEURALNETWORKS_TENSOR_FLOAT32} + * * {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: A tensor, specifying the input. + * * 1: A tensor of the same {@link OperandCode}, and compatible dimensions + * as input0, specifying the alpha. + * + * Outputs: + * * 0: A tensor of the same {@link OperandCode} as input0. + */ + ANEURALNETWORKS_PRELU_EX = 500022, } OperationCodeEx; // extends OperationCode typedef OperationCodeEx ANeuralNetworksOperationTypeEx; -- 2.7.4