File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -68,16 +68,18 @@ pub type Ix5 = Dim<[Ix; 5]>;
6868pub type Ix6 = Dim < [ Ix ; 6 ] > ;
6969/// dynamic-dimensional
7070///
71- /// `Vec<Ix>` and `&[usize]` implement `IntoDimension` to produce `IxDyn`;
72- /// use them to create arrays with a dynamic number of axes.
71+ /// You can use the `IxDyn` function to create a dimension for an array with
72+ /// dynamic number of dimensions. (`Vec<Ix>` and `&[usize]` also implement
73+ /// `IntoDimension` to produce `IxDyn`).
7374///
7475/// ```
7576/// use ndarray::ArrayD;
77+ /// use ndarray::IxDyn;
7678///
7779/// // Create a 5 × 6 × 3 × 4 array using the dynamic dimension type
78- /// let mut a = ArrayD::<f64>::zeros(vec! [5, 6, 3, 4]);
80+ /// let mut a = ArrayD::<f64>::zeros(IxDyn(& [5, 6, 3, 4]) );
7981/// // Create a 1 × 3 × 4 array using the dynamic dimension type
80- /// let mut b = ArrayD::<f64>::zeros(vec! [1, 3, 4]);
82+ /// let mut b = ArrayD::<f64>::zeros(IxDyn(& [1, 3, 4]) );
8183///
8284/// // We can use broadcasting to add arrays of compatible shapes together:
8385/// a += &b;
You can’t perform that action at this time.
0 commit comments