File tree 1 file changed +6
-4
lines changed
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]>;
68
68
pub type Ix6 = Dim < [ Ix ; 6 ] > ;
69
69
/// dynamic-dimensional
70
70
///
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`).
73
74
///
74
75
/// ```
75
76
/// use ndarray::ArrayD;
77
+ /// use ndarray::IxDyn;
76
78
///
77
79
/// // 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]) );
79
81
/// // 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]) );
81
83
///
82
84
/// // We can use broadcasting to add arrays of compatible shapes together:
83
85
/// a += &b;
You can’t perform that action at this time.
0 commit comments