Mojo function
row_major
row_major(var shape: Coord[shape.element_types]) -> Layout[shape.element_types, *?]
Creates a row-major layout from a shape Coord.
Row-major means the rightmost dimension has stride 1, and each preceding dimension has stride equal to the product of all following dimensions.
For shape (M, N, K):
- row_major strides: (N*K, K, 1)
- col_major strides: (1, M, M*N)
Args:
- βshape (
Coord): The shape as a Coord.
Returns:
Layout: A Layout with row-major strides.
row_major[*element_types: CoordLike](var *elements: *element_types.values) -> Layout[element_types, *?]
Creates a row-major layout from a shape Coord.
Row-major means the rightmost dimension has stride 1, and each preceding dimension has stride equal to the product of all following dimensions.
Parameters:
- β*element_types (
CoordLike): The variadic pack of element types that implementCoordLike.
Args:
- β*elements (
*element_types.values): The shape as a Coord.
Returns:
Layout: A Layout with row-major strides.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!