For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
col_major_nested
def col_major_nested(var shape: Coord) -> Layout[shape.element_types, *?]
Creates a column-major layout from a nested shape Coord.
For a nested shape ((a, b), (c, d)) the result has nested strides
((1, a), (a*b, a*b*c)) — col-major over the flattened shape, re-nested.
Currently restricted to all-static (compile-time) leaf dimensions
and one level of nesting. For flat shapes use col_major.
Args:
- shape (
Coord): The nested shape as aCoordwhose top-level elements are themselvesCoords.
Returns:
Layout[shape.element_types, *?]: A Layout with the matching nested column-major strides.