[][src]Function arrayfire::product

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

Compute product of elements along a given dimension

Parameters

Return Values

Result Array after multiplying all elements along given dimension

Examples

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