sortMatrix

fun sortMatrix(sortType: Pipeline.SortType, source: Tensor, sortedResult: Tensor?, indexResult: Tensor?)

Sort a matrix, column-by-column or row-by-row.

Parameters

sortType

whether the sort should be done column-wisely or row-wisely.

source

the matrix to be sorted. It must be a 1-channel multi-dimensional tensor of 2 dimensions.

sortedResult

the optional result to store the sorted matrix. It must also be a 1-channel multi-dimensional tensor of 2 dimensions. It dimensions must be the same as those of source. Its data type must be the same as that of source.

indexResult

the optional result to store the original indices of matrix elements in source's row/column, according to the sortType. It must be a 1-channel multi-dimensional tensor of 2 dimensions. Its dimensions must be the same as those of source. Its data type must be one of integral types.

Throws

If the usage is not allowed by the SpatialML run-time Framework, or if the framework encounter internal error and cannot perform the requested behavior.