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

composition

def composition[A: TensorLayout, B: TensorLayout, //](a: A, b: B) -> ComposedLayout[A, B]

Composes two static layouts: the result maps B's coordinates through B, then through A.

This is CuTe's composition. A thread-value layout composed after an operand's layout gives, per thread, the operand offsets of its values.

Constraints:

Both layouts are fully static, and B's image lies in A's domain.

Parameters:

Args:

  • ​a (A): The outer layout, applied second.
  • ​b (B): The inner layout, applied first.

Returns:

ComposedLayout[A, B]: The composed layout, with B's rank.

Was this page helpful?