|
|
@ -699,7 +699,7 @@ class UniqueWithPad(PrimitiveWithInfer):
|
|
|
|
- idx (Tensor) - The index of each value of x in the unique output y, the shape and type same as x.
|
|
|
|
- idx (Tensor) - The index of each value of x in the unique output y, the shape and type same as x.
|
|
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
Examples:
|
|
|
|
>>> x = Tensor(np.array([[1, 1, 5, 5, 4, 4, 3, 3, 2, 2,]), mindspore.int32)
|
|
|
|
>>> x = Tensor(np.array([1, 1, 5, 5, 4, 4, 3, 3, 2, 2,]), mindspore.int32)
|
|
|
|
>>> pad_num = 8
|
|
|
|
>>> pad_num = 8
|
|
|
|
>>> out = P.UniqueWithPad()(x, pad_num)
|
|
|
|
>>> out = P.UniqueWithPad()(x, pad_num)
|
|
|
|
([1, 5, 4, 3, 2, 8, 8, 8, 8, 8], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4])
|
|
|
|
([1, 5, 4, 3, 2, 8, 8, 8, 8, 8], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4])
|
|
|
|