Mojo struct
MatLayout
@register_passable_trivial
struct MatLayout
Fields
- shape (
IndexList[Int(2)]) - strides (
IndexList[Int(2)])
Implemented traits
AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable, Writable
Methods
__init__
fn def __init__(shape: Tuple[Int, Int], strides: Tuple[Int, Int]) -> Self
Args:
- shape (
Tuple[Int, Int]) - strides (
Tuple[Int, Int])
Returns:
Self
fn def __init__(shape: Tuple[Int, Int]) -> Self
Args:
- shape (
Tuple[Int, Int])
Returns:
Self
__call__
fn def __call__(self, i: Int, j: Int) -> Int
Args:
- self (
Self) - i (
Int) - j (
Int)
Returns:
Int
size
fn def size(self) -> Int
Args:
- self (
Self)
Returns:
Int
write_to
fn def write_to[W: Writer](self, mut writer: W)
Parameters:
- W (
Writer)
Args:
- self (
Self) - writer (
W)