PyTorch torch.dot function
PyTorch torch reference manual
torch.dot is a PyTorch function for computing the dot product of two vectors.
Function definition
torch.dot(input, other, out)
Usage examples
Example
import
torch
a
=
torch.
tensor
(
[
1
,
2
,
3
]
)
b
=
torch.
tensor
(
[
4
,
5
,
6
]
)
Dot product: 14 + 25 + 3*6 = 32
result
=
torch.
dot
(
a
,
b
)
(
result
)
The output is:
tensor(32)