Description: Returns the unique elements of the input tensor.
Each operator has calls. First, aclnnUniqueGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUnique is called to perform computation.
[object Object][object Object]
Parameters:
self (aclTensor*, compute input): aclTensor on the device. The can be ND, and the shape cannot be greater than eight-dimensional.
- [object Object]Atlas training series products[object Object]: The data type can be BOOL, FLOAT, FLOAT16, DOUBLE, UINT8, INT8, UINT16, INT16, INT32, UINT32, UINT64, or INT64.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BOOL, FLOAT, FLOAT16, DOUBLE, UINT8, INT8, UINT16, INT16, INT32, UINT32, UINT64, INT64, or BFLOAT16.
sorted (bool, compute input): whether to sort valueOut in ascending order. The value true indicates sorting in ascending order, and the value false indicates no sorting.
returnInverse (bool, compute input): whether to return the indexes of each input element in valueOut.
valueOut (aclTensor*, compute output): aclTensor on the device, the first output tensor, unique elements in the input tensor. The can be ND.
- [object Object]Atlas training series products[object Object]: The data type can be BOOL, FLOAT, FLOAT16, DOUBLE, UINT8, INT8, UINT16, INT16, INT32, UINT32, UINT64, or INT64.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BOOL, FLOAT, FLOAT16, DOUBLE, UINT8, INT8, UINT16, INT16, INT32, UINT32, UINT64, INT64, or BFLOAT16.
inverseOut (aclTensor*, compute output): the second output tensor. This parameter is valid when returnInverse is True. It returns the indexes of self elements in valueOut. The data type can be INT64, and the shape must be the same as that of self.
workspaceSize (uint64_t*, output): size of the workspace required to be allocated on the device.
executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns:
Parameters:
- workspace (void*, input): address of the workspace to be allocated on the device.
- workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnUniqueGetWorkspaceSize.
- executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
Deterministic compute:
- aclnnUnique defaults to a deterministic implementation.
*[object Object]Atlas training series products[object Object], [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: If the input self contains 0, the output of the operator contains positive 0s and negative 0s, instead of only one 0.
The following example is for reference only. For details, see .