@@ -130,3 +130,38 @@ macro_rules! eval {
130
130
}
131
131
} ;
132
132
}
133
+
134
+ /// Create a dim4 object from provided dimensions
135
+ ///
136
+ /// The user can pass 1 or more sizes and the left over values will default to 1.
137
+ #[ macro_export]
138
+ macro_rules! dim4 {
139
+ ( $dim0: literal) => {
140
+ $crate:: Dim4 :: new( & [ $dim0, 1 , 1 , 1 ] )
141
+ } ;
142
+ ( $dim0: literal, $dim1: literal) => {
143
+ $crate:: Dim4 :: new( & [ $dim0, $dim1, 1 , 1 ] )
144
+ } ;
145
+ ( $dim0: literal, $dim1: literal, $dim2: literal) => {
146
+ $crate:: Dim4 :: new( & [ $dim0, $dim1, $dim2, 1 ] )
147
+ } ;
148
+ ( $dim0: literal, $dim1: literal, $dim2: literal, $dim3: literal) => {
149
+ $crate:: Dim4 :: new( & [ $dim0, $dim1, $dim2, $dim3] )
150
+ } ;
151
+ }
152
+
153
+ /// Create a sequence object
154
+ ///
155
+ /// If type is not provided, then the Seq will default to i32 type
156
+ #[ macro_export]
157
+ macro_rules! seq {
158
+ ( ) => {
159
+ $crate:: Seq :: <i32 >:: default ( )
160
+ } ;
161
+ ( $sty: ty; $start: literal : $end: literal : $step: literal) => {
162
+ $crate:: Seq :: <$sty>:: new( $start, $end, $step)
163
+ } ;
164
+ ( $start: literal : $end: literal : $step: literal) => {
165
+ $crate:: Seq :: <i32 >:: new( $start, $end, $step)
166
+ } ;
167
+ }
0 commit comments