Pytorch Torch Bmm
# PyTorch torch.bmm Function
* * PyTorch torch Reference Manual](#)
`torch.bmm` is a function in PyTorch used to perform batch matrix multiplication.
### Function Definition
torch.bmm(input, mat2, out)
* * *
## Usage Example
## Example
import torch
# Batch matrix multiplication
batch_a = torch.randn(10,3,4)
batch_b = torch.randn(10,4,5)
result = torch.bmm(batch_a, batch_b)
print("Batch result shape:", result.shape)
The output result is:
Batch result shape: torch.Size([10, 3, 5])
* * PyTorch torch Reference Manual](#)
YouTip