[][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

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);