Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


torch (version 0.2.1)

torch_bmm: Bmm

Description

Bmm

Usage

torch_bmm(self, mat2)

Arguments

self

(Tensor) the first batch of matrices to be multiplied

mat2

(Tensor) the second batch of matrices to be multiplied

bmm(input, mat2, out=NULL) -> Tensor

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×n×m) tensor, mat2 is a (b×m×p) tensor, out will be a (b×n×p) tensor.

outi=inputi@mat2i

Examples

Run this code
# NOT RUN {
if (torch_is_installed()) {

input = torch_randn(c(10, 3, 4))
mat2 = torch_randn(c(10, 4, 5))
res = torch_bmm(input, mat2)
res
}
# }

Run the code above in your browser using DataLab