Computes the dot product of two 1D vectors along a dimension.
In symbols, this function computes
∑ i = 1 n x i ‾ y i . \sum_{i=1}^n \overline{x_i}y_i. i=1∑nxiyi.
where x i ‾ \overline{x_i} xi denotes the conjugate for complex vectors, and it is the identity for real vectors.
Note
Unlike NumPy’s vdot, torch.vdot intentionally only supports computing the dot product of two 1D tensors with the same number of elements.
Keyword args:
Note
out (Tensor, optional): the output tensor.
Example:
>>> torch.vdot(torch.tensor([2, 3]), torch.tensor([2, 1])) tensor(7) >>> a = torch.tensor((1 +2j, 3 - 1j)) >>> b = torch.tensor((2 +1j, 4 - 0j)) >>> torch.vdot(a, b) tensor([16.+1.j]) >>> torch.vdot(b, a) tensor([16.-1.j])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4