Function arrayfire::max [] [src]

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

Find maximum among elements of given dimension

Parameters

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

Return Values

Result Array after finding maximum among elements along a given dimension

Examples

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