From c0a59561e47212b3f4e8ab28870ee68d2b841372 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: Tue, 4 Dec 2018 13:30:28 +0530 Subject: [PATCH] Define Gather_Ex op in NeuralNetworkEx.h (#3756) This patch defines Gather_Ex op in NeuralNetworkEx.h Related issue: #3347 Signed-off-by: prasannar --- include/NeuralNetworksEx.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/NeuralNetworksEx.h b/include/NeuralNetworksEx.h index 86d9887..3785b85 100644 --- a/include/NeuralNetworksEx.h +++ b/include/NeuralNetworksEx.h @@ -59,6 +59,40 @@ typedef enum { * * 0: The output tensor, of the same {@link OperandCode} and shape as input0. */ ANEURALNETWORKS_CAST_EX = 50000, + + /** + * Gathers values along an axis. + * + * Produces an output tensor with shape + * input0.dimension[:axis] + indices.dimension + input0.dimension[axis + 1:] + * where: + * # Vector indices (output is rank(input0)). + * output[a_0, ..., a_n, i, b_0, ..., b_n] = + * input0[a_0, ..., a_n, indices[i], b_0, ..., b_n] + * + * # Higher rank indices (output is rank(input0) + rank(indices) - 1). + * output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] = + * input0[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n] + * + * Supported tensor {@link OperandCode}: + * * {@link ANEURALNETWORKS_TENSOR_FLOAT32} + * * {@link ANEURALNETWORKS_TENSOR_INT32} + * * {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM} + * + * Supported tensor rank: from 1 + * + * Inputs: + * * 0: An n-D tensor from which to gather values. + * * 1: A k-D tensor {@link ANEURALNETWORKS_TENSOR_INT32} of indices. + * The values must be in the bounds of the corresponding dimensions + * of input0. + * * 2: An {@link ANEURALNETWORKS_INT32} scalar specifying the axis. + * Negative index is used to specify axis from the end + * (e.g. -1 for the last axis). Must be in the range [-n, n). + * + * Outputs: + * * 0: An (n + k - 1)-D tensor with the same {@link OperandCode} as input0. + */ ANEURALNETWORKS_GATHER_EX = 50001, /**< Gather slices according to indexes and axis */ /** -- 2.7.4