macro_rules! shape {
( $( $label:ident = $size:expr_2021 ),* $(,)? ) => { ... };
}
Expand description
Construct a new shape with the given set of dimension-size pairs in row-major order.
let s = ndslice::shape!(host = 2, gpu = 8);
assert_eq!(s.labels(), &["host".to_string(), "gpu".to_string()]);
assert_eq!(s.slice().sizes(), &[2, 8]);
assert_eq!(s.slice().strides(), &[8, 1]);