[−][src]Trait gulali::attributes::Shape
A list of integers indicating the size of the vector in each dimension
Required methods
fn shape(&self) -> Vec<usize>
Returns a list of integers indicating the length of the vector in each dimension.
Examples
let arr1: Vec<i32> = Vec::one_dim(2).zeros(); assert_eq!(arr1.shape(), [2]); let arr2: Vec<Vec<i32>> = Vec::two_dim(2, 2).zeros(); assert_eq!(arr2.shape(), [2, 2]); let arr3: Vec<Vec<Vec<i32>>> = Vec::three_dim(2, 2, 2).zeros(); assert_eq!(arr3.shape(), [2, 2, 2]); let arr4: Vec<Vec<Vec<Vec<i32>>>> = Vec::four_dim(2, 2, 2, 3).zeros(); assert_eq!(arr4.shape(), [2, 2, 2, 3]);
Implementations on Foreign Types
impl<T> Shape<T> for Vec<T> where
T: Copy,
[src]
T: Copy,
impl<T> Shape<T> for Vec<Vec<T>> where
T: Copy,
[src]
T: Copy,
impl<T> Shape<T> for Vec<Vec<Vec<T>>> where
T: Copy,
[src]
T: Copy,
impl<T> Shape<T> for Vec<Vec<Vec<Vec<T>>>> where
T: Copy,
[src]
Loading content...
T: Copy,