Skip to main content
Log in

Mojo function

inner_product

inner_product(a: IntTuple[origin], b: IntTuple[origin]) -> Int

Compute the inner product of two IntTuples.

For flat tuples, this is the sum of element-wise products. For nested tuples, the function recurses into corresponding nested elements.

Note: If the input tuples have different lengths, abort() will be called.

Args:

  • a (IntTuple[origin]): First IntTuple.
  • b (IntTuple[origin]): Second IntTuple.

Returns:

The inner product as an Int.