View source: R/gen-namespace.R
torch_bmm | R Documentation |
Bmm
torch_bmm(self, mat2)
self |
(Tensor) the first batch of matrices to be multiplied |
mat2 |
(Tensor) the second batch of matrices to be multiplied |
Performs a batch matrix-matrix product of matrices stored in input
and mat2
.
input
and mat2
must be 3-D tensors each containing
the same number of matrices.
If input
is a (b \times n \times m)
tensor, mat2
is a
(b \times m \times p)
tensor, out
will be a
(b \times n \times p)
tensor.
\mbox{out}_i = \mbox{input}_i \mathbin{@} \mbox{mat2}_i
This function does not broadcast .
For broadcasting matrix products, see torch_matmul
.
if (torch_is_installed()) {
input = torch_randn(c(10, 3, 4))
mat2 = torch_randn(c(10, 4, 5))
res = torch_bmm(input, mat2)
res
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.