pub fn reorder_v2<T>(
input: &Array<T>,
new_axis0: u64,
new_axis1: u64,
next_axes: Option<Vec<u64>>
) -> Array<T> where
T: HasAfEnum,
Reorder the array according to the new specified axes
Exchanges data within an array such that the requested change in axes is satisfied. The linear ordering of data within the array is preserved.
The default order of axes in ArrayFire is [0 1 2 3] i.e. axis with smallest distance between adjacent elements followed by next smallest distance axis and so on. See examples to have a basic idea of how data is re-ordered.
input
is the input Arraynew_axis0
is the new first axis for outputnew_axis1
is the new second axis for outputnext_axes
is the new axes order for outputArray with data reordered as per the new axes order
use arrayfire::{Array, Dim4, print, randu, reorder_v2}; let a = randu::<f32>(Dim4::new(&[5, 3, 1, 1])); let b = reorder_v2(&a, 1, 0, None); print(&a); print(&b); let c = reorder_v2(&a, 2, 0, Some(vec![1])); print(&c);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4