latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.vdot
- tensorplay.functional.vdot(input, other, *, out=None) Tensor[source]
Computes the dot product of two 1D vectors along a dimension.
In symbols, this function computes
where denotes the conjugate for complex vectors, and it is the identity for real vectors.
Note
Unlike NumPy’s vdot, tensorplay.vdot intentionally only supports computing the dot product of two 1D tensors with the same number of elements.
See also
tensorplay.linalg.vecdot()computes the dot product of two batches of vectors along a dimension.- Parameters:
Keyword args:
Note
out (Tensor, optional): the output tensor.
Example:
>>> tensorplay.vdot(tensorplay.tensor([2, 3]), tensorplay.tensor([2, 1])) tensor(7) >>> a = tensorplay.tensor((1 +2j, 3 - 1j)) >>> b = tensorplay.tensor((2 +1j, 4 - 0j)) >>> tensorplay.vdot(a, b) tensor([16.+1.j]) >>> tensorplay.vdot(b, a) tensor([16.-1.j])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

