diff --git a/src/tensor.rs b/src/tensor.rs index 3c2df05c..37fedd8a 100644 --- a/src/tensor.rs +++ b/src/tensor.rs @@ -201,6 +201,20 @@ impl IntoTensorDesc for (usize, usize, usize, usize, usize, usize) { } } +macro_rules! impl_array_into_tensor_desc { + ($($N:expr)+) => { + $( + impl IntoTensorDesc for [usize; $N] { + fn into(&self) -> TensorDesc { + let slice: &[_] = self; + From::from(slice) + } + } + )+ + } +} +impl_array_into_tensor_desc!(1 2 3 4 5 6); + impl ITensorDesc for TensorDesc { fn rank(&self) -> usize { self.len()