On this page
torch.dot
torch.dot(input, other, *, out=None) → Tensor
-
Computes the dot product of two 1D tensors.
Note
Unlike NumPy’s dot, torch.dot intentionally only supports computing the dot product of two 1D tensors with the same number of elements.
- Parameters
- Keyword Arguments
-
out (Tensor, optional) – the output tensor.
Example:
>>> torch.dot(torch.tensor([2, 3]), torch.tensor([2, 1])) tensor(7)
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.dot.html