Learn R Programming

GPUmatrix (version 1.0.2)

matrix_general_operators_methods: Return the first or last part of a GPUmatrix object

Description

head and tail mimic the functions head and tail from utils to operate on gpu.matrix-class objects. By default head shows the first 6 rows of a matrix or first 6 elements of a vector or list. tail shows the last 6 rows of a matrix or last 6 elements of a vector or list.

The function show mimics the function show of methods to compute on gpu.matrix-class objects: "It display the object, by printing, plotting or whatever suits its class."

The function print mimics the base function print to operate on gpu.matrix-class objects.

Usage

# S4 method for gpu.matrix.tensorflow
tail(x,...)
# S4 method for gpu.matrix.torch
tail(x,...)
# S4 method for gpu.matrix.tensorflow
show(object)
# S4 method for gpu.matrix.torch
show(object)
# S4 method for gpu.matrix.tensorflow
head(x,...)
# S4 method for gpu.matrix.torch
head(x,...)

# S4 method for gpu.matrix.torch print(x)

Arguments

x,object

a gpu.matrix.

...

arguments to be passed to or from other methods.

See Also

For more information see: head, tail, and show.

Examples

Run this code
# \donttest{
if (FALSE) {
a <- gpu.matrix(rnorm(20*5),20,5)
head(a) #shows the first six row of every column
tail(a) #shows the las six row of every column

show(a) #show all the object
a #equivalente to run the function show.
}
# }

Run the code above in your browser using DataLab