Introduce ONE_HOT, GREATER_EQUAL and LESS operation into NeuralNetworsEx.h (#4736)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Thu, 14 Mar 2019 07:48:05 +0000 (16:48 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 14 Mar 2019 07:48:05 +0000 (16:48 +0900)
* Introduce ONE_HOT_EX operation in NeuralNetworksEx.h

This commit introduces ONE_HOT_EX operation in NeuralNetworsEx.h.

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
* 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 <jiseob.jang@samsung.com>
include/NeuralNetworksEx.h

index a941a10..79059ec 100644 (file)
@@ -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;