megengine.functional.dot¶
- dot(inp1, inp2)[source]¶
Computes dot-product of two vectors
inp1
andinp2
. inputs must be 1-dimensional or scalar. A scalar input is automatically broadcasted. Refer tomatmul
for more general usage.- Parameters
- Return type
- Returns
output value.
Examples
>>> import numpy as np >>> data1 = Tensor(np.arange(0, 6, dtype=np.float32)) >>> data2 = Tensor(np.arange(0, 6, dtype=np.float32)) >>> out = F.dot(data1, data2) >>> out.numpy() array(55., dtype=float32)