From 7431e3d49ec9d5be7ea3cc7d052c6e28fd6c39b0 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 18 May 2020 13:42:42 -0700 Subject: Update NDK APIs from R beta 1. Test: build/soong/scripts/build-ndk-prebuilts.sh Bug: http://b/156912780 Exempt-From-Owner-Approval: copied from beta 1 Change-Id: I49811196ac6b061e58749bf89dd9041417a5eee8 --- nn/runtime/include/NeuralNetworks.h | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/nn/runtime/include/NeuralNetworks.h b/nn/runtime/include/NeuralNetworks.h index 339aba6bf..8911eaf52 100644 --- a/nn/runtime/include/NeuralNetworks.h +++ b/nn/runtime/include/NeuralNetworks.h @@ -978,7 +978,7 @@ typedef enum { ANEURALNETWORKS_HASHTABLE_LOOKUP = 10, /** - * Applies L2 normalization along the depth dimension. + * Applies L2 normalization along the axis dimension. * * The values in the output tensor are computed as: * @@ -986,8 +986,7 @@ typedef enum { * input[batch, row, col, channel] / * sqrt(sum_{c} pow(input[batch, row, col, c], 2)) * - * For input tensor with rank less than 4, independently normalizes each - * 1-D slice along dimension dim. + * By default the axis dimension is the last dimension of the input tensor. * * Supported tensor {@link OperandCode}: * * {@link ANEURALNETWORKS_TENSOR_FLOAT16} (since API level 29) @@ -1013,6 +1012,10 @@ typedef enum { * For {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED}, * the scale must be 1.f / 128 and the zeroPoint must be 0. * + * NOTE: Before API level 30, if the elements along an axis are all zeros, + * the result is undefined. Since API level 30, if the elements along an axis + * are all zeros, the result is logical zero. + * * Available since API level 27. */ ANEURALNETWORKS_L2_NORMALIZATION = 11, @@ -4346,7 +4349,8 @@ typedef enum { * * 1: A scalar {@link ANEURALNETWORKS_INT32}, specifying the number of * independent samples to draw for each row slice. * * 2: A 1-D {@link ANEURALNETWORKS_TENSOR_INT32} tensor with shape [2], - * specifying seeds used to initialize the random distribution. + * specifying seeds used to initialize the random distribution. If both + * provided seeds are 0, both will be randomly generated. * Outputs: * * 0: A 2-D {@link ANEURALNETWORKS_TENSOR_INT32} tensor with shape * [batches, samples], containing the drawn samples. @@ -6797,8 +6801,9 @@ int ANeuralNetworksExecution_compute(ANeuralNetworksExecution* execution) __INTR * Get the dimensional information of the specified output operand of the model of the * {@link ANeuralNetworksExecution}. * - * On asynchronous execution initiated by {@link ANeuralNetworksExecution_startCompute} - * or {@link ANeuralNetworksExecution_startComputeWithDependencies}, + * The execution must have completed. On asynchronous execution initiated by + * {@link ANeuralNetworksExecution_startCompute} or + * {@link ANeuralNetworksExecution_startComputeWithDependencies}, * {@link ANeuralNetworksEvent_wait} must be called prior to this function. * * @param execution The execution to be queried. @@ -6822,8 +6827,9 @@ int ANeuralNetworksExecution_getOutputOperandRank(ANeuralNetworksExecution* exec * Get the dimensional information of the specified output operand of the model of the * {@link ANeuralNetworksExecution}. The target output operand cannot be a scalar. * - * On asynchronous execution initiated by {@link ANeuralNetworksExecution_startCompute} - * or {@link ANeuralNetworksExecution_startComputeWithDependencies}, + * The execution must have completed. On asynchronous execution initiated by + * {@link ANeuralNetworksExecution_startCompute} or + * {@link ANeuralNetworksExecution_startComputeWithDependencies}, * {@link ANeuralNetworksEvent_wait} must be called prior to this function. * * @param execution The execution to be queried. @@ -6977,9 +6983,11 @@ int ANeuralNetworksExecution_setMeasureTiming(ANeuralNetworksExecution* executio /** * Get the time spent in the specified {@link ANeuralNetworksExecution}, in nanoseconds. - * The execution must have completed. * - * Available since API level 29. + * The execution must have completed. On asynchronous execution initiated by + * {@link ANeuralNetworksExecution_startCompute} or + * {@link ANeuralNetworksExecution_startComputeWithDependencies}, + * {@link ANeuralNetworksEvent_wait} must be called prior to this function. * * @param execution The execution to be queried. * @param durationCode The measurement to be queried, specified by {@link DurationCode}. @@ -6992,6 +7000,8 @@ int ANeuralNetworksExecution_setMeasureTiming(ANeuralNetworksExecution* executio * need not support any given measurement. * * @return ANEURALNETWORKS_NO_ERROR if successful. + * + * Available since API level 29. */ int ANeuralNetworksExecution_getDuration(const ANeuralNetworksExecution* execution, int32_t durationCode, uint64_t* duration) @@ -8069,12 +8079,6 @@ int ANeuralNetworksEvent_getSyncFenceFd(const ANeuralNetworksEvent* event, int* * will be returned through {@link ANeuralNetworksEvent_wait} on the event * object. * - * If this execution contains a {@link ANEURALNETWORKS_WHILE} operation, and - * the condition model does not output false within the loop timeout duration, - * then execution will be aborted and {@link ANEURALNETWORKS_MISSED_DEADLINE_*} - * will be returned through {@link ANeuralNetworksEvent_wait} on the event - * object. - * * See {@link ANeuralNetworksExecution} for information on multithreaded usage. * * See {@link ANeuralNetworksExecution_compute} for synchronous execution. -- cgit v1.2.3