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:
- βA (
TensorLayout): The outer layout's type. - βB (
TensorLayout): The inner layout's type.
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.