You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a and b, computes the dot product according to the following rules:
If both a and b are scalars, it is equivalent to a * b.
If a is a scalar and b is a tensor, it is equivalent to Nx.multiply(a, b).
If a is a tensor and b is a scalar, it is equivalent to Nx.multiply(a, b).
If both a and b are 1-D tensors (vectors), it is the sum of the element-wise product between a and b. The lengths of a and b must be equal.
If both a and b are 2-D tensors (matrices), it is equivalent to matrix-multiplication.
If either a or b is a 1-D tensor, and the other is an n-D tensor, it is the sum of the element-wise product along the last axis of a or b. The length of the 1-D tensor must match the last dimension of the n-D tensor.
If a is an n-D tensor and b is an m-D tensor, it is the sum of the element-wise product along the last axis of a and the second-to-last axis of b. The last dimension of a must match the second-to-last dimension of b.
Cases:
If both a and b are scalars, it is equivalent to a * b.
If a is a scalar and b is a tensor, it is equivalent to Nx.multiply(a, b).
If a is a tensor and b is a scalar, it is equivalent to Nx.multiply(a, b).
If both a and b are 1-D tensors (vectors), it is the sum of the element-wise product between a and b. The lengths of a and b must be equal.
If both a and b are 2-D tensors (matrices), it is equivalent to matrix-multiplication.
If either a or b is a 1-D tensor, and the other is an n-D tensor, it is the sum of the element-wise product along the last axis of a or b. The length of the 1-D tensor must match the last dimension of the n-D tensor. (feat: dot/2 supports receiving 1-D tensors (vectors) #17)
If a is an n-D tensor and b is an m-D tensor, it is the sum of the element-wise product along the last axis of a and the second-to-last axis of b. The last dimension of a must match the second-to-last dimension of b. (feat: Nx.dot, support n x m #51)
Right now is partially implemented given the limitation of having only matmul in candle-core.
Nx.dot/2
:Cases:
Right now is partially implemented given the limitation of having only
matmul
incandle-core
.See partial test coverage we have in
candlex/test/candlex_test.exs
Lines 500 to 655 in b55a50b
The text was updated successfully, but these errors were encountered: