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).
row_major_nested
def row_major_nested(var shape: Coord) -> Layout[shape.element_types, *?]
Creates a row-major layout from a nested shape Coord.
For a nested shape ((a, b), (c, d)) the result has nested strides
((b*c*d, c*d), (d, 1)) — row-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 row_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 row-major strides.