torch.
bmm
(batch1, batch2, out=None) → Tensor
Performs a batch matrix-matrix product of matrices stored in batch1
and batch2
.
batch1
and batch2
must be 3-D tensors each containing the same number of matrices.
If batch1
is a ensor.
Note
This function does not broadcast. For broadcasting matrix products, see torch.matmul()
.
Parameters: |
---|
Example:
>>> batch1 = torch.randn(10, 3, 4)
>>> batch2 = torch.randn(10, 4, 5)
>>> res = torch.bmm(batch1, batch2)
>>> res.size()
torch.Size([10, 3, 5])
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:pytorch中的math operation: torch.bmm() - Python技术站