Macro alumina::shape [−][src]
macro_rules! shape { (@parse $x:expr) => { ... }; [ $($x:expr),+ ] => { ... }; }
NodeShape constructor.
Returns a value of the type NodeShape
Three types of values can be entered as a list into the macro, with the following conversions taking place:
Value | Output | |
---|---|---|
Unknown | => | NodeDim::Unknown` |
5 | => | NodeDim::Known(5)` |
(4, 7) | => | NodeDim::Interval{lower:4, upper:7}` |
#Example
#[macro_use] extern crate alumina; use alumina::shape::{NodeDim, NodeShape}; fn main() { let s1: NodeShape = shape![Unknown, 5, (3, 9), 7]; let s2: NodeShape = NodeShape::from(&[NodeDim::Unknown, NodeDim::Known(5), NodeDim::Interval{lower:3, upper:9}, NodeDim::Known(7)]); assert_eq!(s1, s2); }