tf.keras.ops.inner

Return the inner product of two tensors.

Ordinary inner product of vectors for 1-D tensors (without complex conjugation), in higher dimensions a sum product over the last axes.

Multidimensional arrays are treated as vectors by flattening all but their last axes. The resulting dot product is performed over their last axes.

x1 First input tensor.
x2 Second input tensor. The last dimension of x1 and x2 must match.

Output tensor. The shape of the output is determined by broadcasting the shapes of x1 and x2 after removing their last axes.