[object Object][object Object][object Object]undefined
[object Object]

Removes duplicate elements from the input tensor self and returns the unique elements in self. This is an enhanced unique function, with a new return value countsOut indicating the number of occurrences for where elements in the input self map to in valueOut, controlled by the returnCounts parameter.

[object Object]

Each operator has calls. First, aclnnUnique2GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnUnique2 is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown:

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:

    • aclnnUnique2 defaults to a deterministic implementation.
    • Ascend 950PR/Ascend 950DT:
      • Due to differences in the implementation of the deduplication algorithm, the operator ignores the value of the sorted input parameter and sorts the output results in ascending order when all of the following conditions are met:
        • The self input is 1D.
        • The data type of self is FLOAT, FLOAT16, UINT8, INT8, UINT16, INT16, INT32, UINT32, UINT64, INT64, or BFLOAT16.
      • Due to differences in the implementation of the deduplication algorithm, the inverseOut output of the operator is meaningless when all of the following conditions are met:
        • The returnInverse input is false.
        • The self input is 1D.
        • The data type of self is FLOAT, FLOAT16, UINT8, INT8, UINT16, INT16, INT32, UINT32, UINT64, INT64, or BFLOAT16.
    • For [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], if the input self contains 0, the output of the operator may contain both positive 0 and negative 0, instead of only one 0.
    • For [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], when the data volume of self exceeds 200 million, the execution time is long and the operation may time out.
[object Object]

The following example is for reference only. For details, see .

[object Object]