pub fn assign_gen<T>(lhs: &mut Array<T>, indices: &Indexer<'_>, rhs: &Array<T>) where
T: HasAfEnum,
Assign an Array to another after indexing it using any combination of Array's and Sequence's
use arrayfire::{Array, Dim4, Seq, print, randu, constant, Indexer, assign_gen}; let values: [f32; 3] = [1.0, 2.0, 3.0]; let indices = Array::new(&values, Dim4::new(&[3, 1, 1, 1])); let seq4gen = Seq::new(0.0, 2.0, 1.0); let mut a = randu::<f32>(Dim4::new(&[5, 3, 1, 1])); let b = constant(2.0 as f32, Dim4::new(&[3, 3, 1, 1])); let mut idxrs = Indexer::default(); idxrs.set_index(&indices, 0, None); idxrs.set_index(&seq4gen, 1, Some(false)); assign_gen(&mut a, &idxrs, &b); println!("a(indices, seq(0, 2, 1))"); print(&a);
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