Implementing kernel
C++ engine symbols that back this Python API.Inner product over the last axes of two tensors.
Behaves like dot for 1-D inputs and like a generalised
outer-then-contract for higher ranks.
Parameters
Returns
TensorResult with shape x.shape[:-1] + y.shape[:-1].
Notes
Contracts the last axis of both operands and sums:
For 1-D inputs, this is the standard vector dot product. For higher
ranks the leading axes of x and y stay independent and come out
consecutively. A 0-d operand has no axis to contract: the result is
x * y, with that product's dtype promotion.
Examples
>>> import lucid
>>> from lucid.linalg import inner
>>> inner(lucid.tensor([1.0, 2.0]), lucid.tensor([3.0, 4.0]))
tensor(11.)