Mimic of the 'base' functions %*%
, crossprod
, tcrossprod
to operate on gpu.matrix-class objects.
# S4 method for gpu.matrix.tensorflow,ANY
%*%(x, y)
# S4 method for gpu.matrix.torch,ANY
%*%(x, y)# S4 method for gpu.matrix.tensorflow,ANY
crossprod(x, y,...)
# S4 method for gpu.matrix.tensorflow,missing
crossprod(x, y = NULL,...)
# S4 method for gpu.matrix.tensorflow,ANY
tcrossprod(x, y,...)
# S4 method for gpu.matrix.tensorflow,missing
tcrossprod(x, y = NULL,...)
# S4 method for gpu.matrix.torch,ANY
crossprod(x, y,...)
# S4 method for gpu.matrix.torch,missing
crossprod(x, y = NULL,...)
# S4 method for gpu.matrix.torch,ANY
tcrossprod(x, y,...)
# S4 method for gpu.matrix.torch,missing
tcrossprod(x, y = NULL,...)
A gpu.matrix-class object with the result of the matrix product.
a gpu.matrix
.
a gpu.matrix
, 'matrix' or 'Matrix' object. For the functions tcrossprod
and crossprod
is NULL (by default), that is equivalent to x=y
.
potentially more arguments passed to and from methods.
signature(x = "gpu.matrix.tensorflow", y = "ANY")
:
Matrix multiplication
signature(x = "gpu.matrix.tensorflow", y = "ANY")
:
Matrix multiplication
signature(x = "gpu.matrix.tensorflow", y = "missing")
:
Matrix multiplication
signature(x = "gpu.matrix.tensorflow", y = "ANY")
:
Matrix multiplication
signature(x = "gpu.matrix.tensorflow", y = "missing")
:
Matrix multiplication
signature(x = "gpu.matrix.torch", y = "ANY")
:
Matrix multiplication
signature(x = "gpu.matrix.torch", y = "ANY")
:
Matrix multiplication
signature(x = "gpu.matrix.torch", y = "missing")
:
Matrix multiplication
signature(x = "gpu.matrix.torch", y = "ANY")
:
Matrix multiplication
signature(x = "gpu.matrix.torch", y = "missing")
:
Matrix multiplication
Internally, these functions call the appropriate tensorflow or torch function to perform the matrix product (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
.
tcrossprod
in R's base, and
crossprod
and %*%
.
Matrix package %&%
for boolean matrix product
methods.
Also see torch_matmul
# \donttest{
if (FALSE) {
a <- gpu.matrix(rnorm(12),nrow=4,ncol=3)
b <- t(a)
b
crossprod(a,a)
b <- a
b
tcrossprod(a)
}
# }
Run the code above in your browser using DataLab