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.index_gen.html below:

arrayfire::index_gen - Rust

[−][src]Function arrayfire::index_gen
pub fn index_gen<T>(input: &Array<T>, indices: Indexer<'_>) -> Array<T> where
    T: HasAfEnum

Index an Array using any combination of Array's and Sequence's

use arrayfire::{Array, Dim4, Seq, print, randu, index_gen, Indexer};
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 a = randu::<f32>(Dim4::new(&[5, 3, 1, 1]));








let mut idxrs = Indexer::default();
idxrs.set_index(&indices, 0, None); 
idxrs.set_index(&seq4gen, 1, Some(false)); 

let sub2 = index_gen(&a, idxrs);
println!("a(indices, seq(0, 2, 1))"); print(&sub2);




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