pub fn all_true_by_key<KeyType, ValueType>(
keys: &Array<KeyType>,
vals: &Array<ValueType>,
dim: i32,
) -> (Array<KeyType>, Array<ValueType::AggregateOutType>)
Expand description
Key based AND of elements along a given dimension
All positive non-zero values are considered true, while negative and zero values are considered as false.
§Parameters
keys
- key Arrayvals
- value Arraydim
- Dimension along which the input Array is reduced
§Return Values
Tuple of Arrays, with output keys and values after reduction
§Examples
use arrayfire::{Dim4, print, randu, all_true_by_key};
let dims = Dim4::new(&[5, 3, 1, 1]);
let vals = randu::<f32>(dims);
let keys = randu::<u32>(Dim4::new(&[5, 1, 1, 1]));
print(&vals);
print(&keys);
let (out_keys, out_vals) = all_true_by_key(&keys, &vals, 0);
print(&out_keys);
print(&out_vals);