- Description: Removes duplicates from the input tensor
[object Object]along a given dim. - Example: Assume that
[object Object]is and[object Object]is 0, then[object Object]is:[object Object]is:[object Object]is:
Each operator has calls. First, aclnnUniqueDimGetWorkspaceSize is called to obtain the input parameters and to compute the workspace size required for computation. Then, aclnnUniqueDim is called to perform computation.
[object Object][object Object]
Parameters:
- self (aclTensor*, compute input):
[object Object]in the example, aclTensor on the device. The shape can be one- to eight-dimensional. are supported. The can be ND.- [object Object]Atlas training series products[object Object]: The data type can be FLOAT, FLOAT16, UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64, DOUBLE, or BOOL.
- [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 FLOAT, FLOAT16, UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64, DOUBLE, BOOL, or BFLOAT16.
- sorted (bool, compute input): whether the returned output result
[object Object]is sorted. - returnInverse (bool, compute input): whether to return the position subscripts of elements in valueOut corresponding to elements of self on the dim axis. True indicates that the subscripts are returned, and False indicates that the subscripts are not returned.
- dim (int64_t, compute input):
[object Object]in the example, integer on the host, specifying the dimension to apply the unique operation upon. The data type can be INT64. The value range is [–self.dim(), self.dim()). - valueOut (aclTensor*, compute output):
[object Object]in the example, indicating the unique operation result, aclTensor on the device. The data type is the same as that of[object Object]. are supported. The can be ND.- [object Object]Atlas training series products[object Object]: The data type can be FLOAT, FLOAT16, UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64, DOUBLE, or BOOL.
- [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 FLOAT, FLOAT16, UINT8, INT8, UINT16, INT16, UINT32, INT32, UINT64, INT64, DOUBLE, BOOL, or BFLOAT16.
- inverseOut (aclTensor*, compute output):
[object Object]in the example, aclTensor on the device, indicating the position subscript of each[object Object]element on the[object Object]axis in valueOut. The data type can be INT64. - countsOut (aclTensor*, compute output):
[object Object]in the example, aclTensor on the device, indicating the number of occurrences of each[object Object]element in[object Object]. The data type can be INT64. - 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.
- self (aclTensor*, compute input):
Returns:
[object Object]
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 aclnnUniqueDimGetWorkspaceSize.
- executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
- Deterministic compute:
- aclnnUniqueDim defaults to a deterministic implementation.
- Performance:
- On A2, A3, and training series products, when the dimension value of self on dim exceeds 200 million, the performance is poor or even the running times out.
The following example is for reference only. For details, see .
[object Object]