A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://arrayfire.github.io/arrayfire-rust/arrayfire/fn.any_true_by_key.html below:

arrayfire::any_true_by_key - Rust

[−][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.

Tuple of Arrays, with output keys and values after reduction

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4