[−][src]Function arrayfire::any_true_by_key
pub fn any_true_by_key<KeyType, ValueType>(
keys: &Array<KeyType>,
vals: &Array<ValueType>,
dim: i32
) -> (Array<KeyType>, Array<ValueType::AggregateOutType>) where
KeyType: ReduceByKeyInput,
ValueType: HasAfEnum,
ValueType::AggregateOutType: HasAfEnum,
Key based OR 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, any_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) = any_true_by_key(&keys, &vals, 0); print(&out_keys); print(&out_vals);