Addbmm
Source:R/gen-namespace-docs.R, R/gen-namespace-examples.R, R/gen-namespace.R
torch_addbmm.RdAddbmm
addbmm(input, batch1, batch2, *, beta=1, alpha=1, out=NULL) -> Tensor
Performs a batch matrix-matrix product of matrices stored
in batch1 and batch2,
with a reduced add step (all matrix multiplications get accumulated
along the first dimension).
input is added to the final result.
batch1 and batch2 must be 3-D tensors each containing the
same number of matrices.
If batch1 is a batch2 is a
input must be
broadcastable with a out will be a
FloatTensor or DoubleTensor, arguments beta and alpha
must be real numbers, otherwise they should be integers.
Examples
if (torch_is_installed()) {
M = torch_randn(c(3, 5))
batch1 = torch_randn(c(10, 3, 4))
batch2 = torch_randn(c(10, 4, 5))
torch_addbmm(M, batch1, batch2)
}
#> torch_tensor
#> 3.6482 -1.8152 8.0992 -2.6312 -1.6254
#> -5.5084 8.3278 0.2868 -0.0026 -8.4114
#> 2.6713 5.4061 -2.3273 -8.0503 -2.3815
#> [ CPUFloatType{3,5} ]