oneflow.dot

oneflow.dot()

This operator computes the dot product of tensor input and other.

The equation is:

$$ \sum_{i=1}^{n}(x[i] * y[i]) $$

Parameters
  • input (Tensor) – first tensor in the dot product.

  • other (Tensor) – second tensor in the dot product.

Shape:
  • input: Input must be 1D.

  • other: Other must be 1D.

For example:

>>> import oneflow as flow
>>> flow.dot(flow.Tensor([2, 3]), flow.Tensor([2, 1]))
tensor(7., dtype=oneflow.float32)