[][src]Function arrayfire::product

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

Compute product of elements along a given dimension

Parameters

  • input - Input Array
  • dim - Dimension along which the input Array will be reduced

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