shift

Function shift 

Source
pub fn shift<T>(input: &Array<T>, offsets: &[i32; 4]) -> Array<T>
where T: HasAfEnum,
Expand description

“Circular shift of values along specified dimension

§Parameters

  • input is the input Array
  • offsets is 4-value tuple that specifies the shift along respective dimension

§Return Values

An Array with shifted data.

§Examples

use arrayfire::{Array, Dim4, print, randu, shift};
let a  = randu::<f32>(Dim4::new(&[5, 1, 1, 1]));
let _a = shift(&a, &[-1i32, 1 , 1, 1]); //shift data one step backward
let a_ = shift(&a, &[ 1i32, 1 , 1, 1]); //shift data one step forward
print(& a);
print(&_a);
print(&a_);