Skip to main content

shape

Macro shape 

Source
macro_rules! shape {
    ($dtype:ident; $($d:tt),+ $(,)?) => { ... };
    ($($d:tt),+ $(,)?) => { ... };
}
Expand description

Build a Shape. Default dtype is F32.

Dynamic dimensions: ? → symbol 0 (repeat ? for the same unknown size), ?1 → symbol 1, etc.

use rlx_tensor::{shape, DType};

let a = shape![2, 4];
let b = shape![F32; ?, 128];
assert_eq!(b.dtype(), DType::F32);
assert!(!b.is_static());