Function arrayfire::product [] [src]

pub fn product(input: &Array, dim: i32) -> Array

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