@@ -513,11 +513,14 @@ where
513
513
temp. into ( )
514
514
}
515
515
516
- /// Reorder the array in specified order
516
+ /// Reorder the array according to the new specified axes
517
517
///
518
- /// The default order of axes in ArrayFire is axis with smallest distance
519
- /// between adjacent elements towards an axis with highest distance between
520
- /// adjacent elements.
518
+ /// Exchanges data within an array such that the requested change in axes is
519
+ /// satisfied. The linear ordering of data within the array is preserved.
520
+ ///
521
+ /// The default order of axes in ArrayFire is [0 1 2 3] i.e. axis with smallest
522
+ /// distance between adjacent elements followed by next smallest distance axis and
523
+ /// so on. See [examples](#examples) to have a basic idea of how data is re-ordered.
521
524
///
522
525
///# Parameters
523
526
///
@@ -537,7 +540,29 @@ where
537
540
/// let a = randu::<f32>(Dim4::new(&[5, 3, 1, 1]));
538
541
/// let b = reorder_v2(&a, 1, 0, None);
539
542
/// print(&a);
543
+ ///
544
+ /// // [5 3 1 1]
545
+ /// // 0.8104 0.2990 0.3014
546
+ /// // 0.6913 0.2802 0.6938
547
+ /// // 0.7821 0.1480 0.3513
548
+ /// // 0.3054 0.1330 0.7176
549
+ /// // 0.1673 0.4696 0.1181
550
+ ///
540
551
/// print(&b);
552
+ /// // [3 5 1 1]
553
+ /// // 0.8104 0.6913 0.7821 0.3054 0.1673
554
+ /// // 0.2990 0.2802 0.1480 0.1330 0.4696
555
+ /// // 0.3014 0.6938 0.3513 0.7176 0.1181
556
+ ///
557
+ /// let c = reorder_v2(&a, 2, 0, Some(vec![1]));
558
+ /// print(&c);
559
+ ///
560
+ /// // [1 5 3 1]
561
+ /// // 0.8104 0.6913 0.7821 0.3054 0.1673
562
+ /// //
563
+ /// // 0.2990 0.2802 0.1480 0.1330 0.4696
564
+ /// //
565
+ /// // 0.3014 0.6938 0.3513 0.7176 0.1181
541
566
/// ```
542
567
pub fn reorder_v2 < T > (
543
568
input : & Array < T > ,
0 commit comments