sort {GPUmatrix}R Documentation

sort

Description

This function mimics the 'base' function sort to operate on gpu.matrix-class objects. This function sort the input matrix into ascending or descending order.

Usage


## S4 method for signature 'gpu.matrix.tensorflow,logical'
sort(x,decreasing)
## S4 method for signature 'gpu.matrix.torch,logical'
sort(x,decreasing)

Arguments

x

a gpu.matrix.

decreasing

Logical. Should the sort be increasing or decreasing?

Details

The function internally calls the corresponding function of the library torch or tensorflow (depending on the type of input gpu.matrix-class).

If the input gpu.matrix-class object(s) are stored on the GPU, then the operations will be performed on the GPU. See gpu.matrix.

Value

Returns a gpu.matrix-class object that is a vector (or a matrix with one column) with the values sorted.

See Also

sort, torch_sort.

Examples


## Not run: 
a <- gpu.matrix(rnorm(9),nrow=3,ncol=3)
sort(a) #returns a vector with the data sorted.

## End(Not run)


[Package GPUmatrix version 1.0.2 Index]