[][src]Function arrayfire::accum

pub fn accum<T>(input: &Array<T>, dim: i32) -> Array<T::AggregateOutType> where
    T: HasAfEnum,
    T::AggregateOutType: HasAfEnum

Perform exclusive sum of elements along a given dimension

Parameters

  • input - Input Array
  • dim - Dimension along which the exclusive scan operation is carried out

Return Values

Result Array with exclusive sums of input Array elements along a given dimension

Examples

use arrayfire::{Dim4, print, randu, accum};
let dims = Dim4::new(&[5, 3, 1, 1]);
let a = randu::<f32>(dims);
print(&a);
let b = accum(&a, 0);
print(&b);
let c = accum(&a, 1);
print(&c);