matrix-product {GPUmatrix} | R Documentation |
Matrix Products
Description
Mimic of the 'base' functions %*%
, crossprod
, tcrossprod
to operate on gpu.matrix-class objects.
Usage
## S4 method for signature 'gpu.matrix.tensorflow,ANY'
x %*% y
## S4 method for signature 'gpu.matrix.torch,ANY'
x %*% y
## S4 method for signature 'gpu.matrix.tensorflow,ANY'
crossprod(x, y,...)
## S4 method for signature 'gpu.matrix.tensorflow,missing'
crossprod(x, y = NULL,...)
## S4 method for signature 'gpu.matrix.tensorflow,ANY'
tcrossprod(x, y,...)
## S4 method for signature 'gpu.matrix.tensorflow,missing'
tcrossprod(x, y = NULL,...)
## S4 method for signature 'gpu.matrix.torch,ANY'
crossprod(x, y,...)
## S4 method for signature 'gpu.matrix.torch,missing'
crossprod(x, y = NULL,...)
## S4 method for signature 'gpu.matrix.torch,ANY'
tcrossprod(x, y,...)
## S4 method for signature 'gpu.matrix.torch,missing'
tcrossprod(x, y = NULL,...)
Arguments
x |
a |
y |
a |
... |
potentially more arguments passed to and from methods. |
Details
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
.
Value
A gpu.matrix-class object with the result of the matrix product.
Methods
- %*%
signature(x = "gpu.matrix.tensorflow", y = "ANY")
: Matrix multiplication- crossprod
signature(x = "gpu.matrix.tensorflow", y = "ANY")
: Matrix multiplication- crossprod
signature(x = "gpu.matrix.tensorflow", y = "missing")
: Matrix multiplication- tcrossprod
signature(x = "gpu.matrix.tensorflow", y = "ANY")
: Matrix multiplication- tcrossprod
signature(x = "gpu.matrix.tensorflow", y = "missing")
: Matrix multiplication- %*%
signature(x = "gpu.matrix.torch", y = "ANY")
: Matrix multiplication- crossprod
signature(x = "gpu.matrix.torch", y = "ANY")
: Matrix multiplication- crossprod
signature(x = "gpu.matrix.torch", y = "missing")
: Matrix multiplication- tcrossprod
signature(x = "gpu.matrix.torch", y = "ANY")
: Matrix multiplication- tcrossprod
signature(x = "gpu.matrix.torch", y = "missing")
: Matrix multiplication
See Also
tcrossprod
in R's base, and
crossprod
and %*%
.
Matrix package %&%
for boolean matrix product
methods.
Also see torch_matmul
Examples
## Not run:
a <- gpu.matrix(rnorm(12),nrow=4,ncol=3)
b <- t(a)
b
crossprod(a,a)
b <- a
b
tcrossprod(a)
## End(Not run)