IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

inner_product

def inner_product(a: IntTuple, b: IntTuple) -> 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, assertion fails.

Args:

Returns:

Int: The inner product as an Int.

Was this page helpful?