Shortcuts

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
  • input (Tensor) – first tensor in the dot product, must be 1D.

  • other (Tensor) – second tensor in the dot product, must be 1D.

Keyword Arguments

{out}

Example:

>>> torch.dot(torch.tensor([2, 3]), torch.tensor([2, 1]))
tensor(7)

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources