mindspore.Tensor.dot

View Source On Gitee
Tensor.dot(other) Tensor

Computes the dot product of two 1D tensor.

Parameters

other (Tensor) – The input in the dot product, must be 1D.

Returns

Tensor, the shape is [] and the data type is same as self.

Raises
Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> from mindspore import Tensor
>>> input = Tensor([2.0, 3.0], mindspore.float32)
>>> other = Tensor([2.0, 1.0], mindspore.float32)
>>> output = Tensor.dot(input, other)  # input.dot(other)
>>> print(output)
[7.        ]
>>> print(output.dtype)
Float32