vbitsort
Function
vbitsort instruction abstraction.
Sorts data based on the x input and provides the original index data of the elements after sorting. Therefore, the shape of the output vector tensor is twice that of the x data.
Prototype
1 | class vbitsort(x, y, z) |
Parameters
Parameter |
Input/Output |
Data Type |
Description |
|---|---|---|---|
x |
Input |
Tensor variable |
Input vector tensor. FP16 and FP32 are supported. |
y |
Input |
Tensor variable |
Input vector tensor. UINT32 is supported. |
z |
Output |
Tensor variable |
Output vector tensor. FP16 and FP32 are supported. |
Example
1 2 3 4 5 6 | from mskpp import vbitsort, Tensor ub_x, ub_y, ub_z = Tensor("UB"), Tensor("UB"), Tensor("UB") gm_x, gm_y = Tensor("GM"), Tensor("GM") ub_x.load(gm_x) ub_y.load(gm_y) out = vbitsort(ub_x, ub_y, ub_z)() |
Parent topic: Description of msKPP External APIs