From e4cc373647f3ba2eb53fd55720e9c14870f03a16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9E=A5=EC=A7=80=EC=84=AD/On-Device=20Lab=28SR=29/Enginee?= =?utf8?q?r/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 14 Mar 2019 16:48:05 +0900 Subject: [PATCH] Introduce ONE_HOT, GREATER_EQUAL and LESS operation into NeuralNetworsEx.h (#4736) * Introduce ONE_HOT_EX operation in NeuralNetworksEx.h This commit introduces ONE_HOT_EX operation in NeuralNetworsEx.h. Signed-off-by: jiseob.jang * Introduce GREATER_EQUAL_EX and LESS_EX operations in NeuralNetworksEx.h This commit introduces GREATER_EQUAL_EX and LESS_EX operations in NeuralNetworksEx.h Signed-off-by: jiseob.jang --- include/NeuralNetworksEx.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/include/NeuralNetworksEx.h b/include/NeuralNetworksEx.h index a941a10..79059ec 100644 --- a/include/NeuralNetworksEx.h +++ b/include/NeuralNetworksEx.h @@ -638,6 +638,83 @@ typedef enum { * * 0: A tensor of the same {@link OperandCode} as input0. */ ANEURALNETWORKS_PRELU_EX = 500022, + + /** + * Returns a one-hot tensor. + * + * The locations represented by indices in indices take value on_value, while all other locations + * take value off_value. + * The on_value and off_value must have matching data types. They must be the same data type as + * specified by the data type of output. + * + * If the input indices is rank N, the output will have rank N+1. The new axis is created at + * dimension axis. + * If indices is a scalar the output shape will be a vector of length depth. + * + * Supported tensor {@link OperandCode}: + * * {@link ANEURALNETWORKS_TENSOR_FLOAT32} + * * {@link ANEURALNETWORKS_TENSOR_INT32} + * + * Supported tensor rank: up to 4 + * + * Inputs: + * * 0: An {@link ANEURALNETWORKS_INT32} tensor, specifying the indices. + * * 1: An {@link ANEURALNETWORKS_INT32} scalar, specifying the depth. + * * 2: A scalar, specifying the on_value. + * * 3: A scalar, specifying the off_value. + * * 4: An {@link ANEURALNETWORKS_INT32} scalar, specifying the axis to fill. Optional. + * (default: -1, a new inner-most axis). + * + * Outputs: + * * 0: The one-hot tensor. + */ + ANEURALNETWORKS_ONE_HOT_EX = 50023, + + /** + * For input tensors x and y, computes x >= y elementwise. + * + * Supported tensor {@link OperandCode}: + * * {@link ANEURALNETWORKS_TENSOR_FLOAT32} + * * {@link ANEURALNETWORKS_TENSOR_INT32} + * * {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandCode} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A boolean tensor of {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} + * with offset 0 and scale 1.0f. + */ + ANEURALNETWORKS_GREATER_EQUAL_EX = 50024, + + /** + * For input tensors x and y, computes x < y elementwise. + * + * Supported tensor {@link OperandCode}: + * * {@link ANEURALNETWORKS_TENSOR_FLOAT32} + * * {@link ANEURALNETWORKS_TENSOR_INT32} + * * {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} + * + * Supported tensor rank: from 1 + * + * This operation supports broadcasting. + * + * Inputs: + * * 0: A tensor. + * * 1: A tensor of the same {@link OperandCode} and dimensions compatible + * with input0. + * + * Outputs: + * * 0: A tensor of {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} + * with offset 0 and scale 1.0f. + */ + ANEURALNETWORKS_LESS_EX = 50025, } OperationCodeEx; // extends OperationCode typedef OperationCodeEx ANeuralNetworksOperationTypeEx; -- 2.7.4