[src] Macro arrayfire::eval

macro_rules! eval {
 ( $l:ident [ $($lb:literal : $le:literal : $ls:literal),+ ] =
 $r:ident [ $($rb:literal : $re:literal : $rs:literal),+ ]) => { ... };
 ( $l:ident [ $($lb:literal : $le:literal : $ls:literal),+ ] = $r:expr ) => { ... };
 ($lhs:ident [ $($lhs_e:expr),+ ] = $rhs:ident [ $($rhs_e:expr),+ ]) => { ... };
 ($lhs:ident [ $($lhs_e:expr),+ ] = $rhs:expr) => { ... };
 [$($x:expr),+] => { ... };
}

Macro to evaluate individual Arrays or assignment operations

  • Evaluate on one or more Array identifiers: essentially calls Array::eval on each of those Array objects individually.

    use arrayfire::{dim4, eval, randu};
    let dims = dim4!(5, 5);
    let a = randu::<f32>(dims);
    let b = a.clone();
    let c = a.clone();
    let d = a.clone();
    let x = a - b;
    let y = c * d;
    eval!(&x, &y);
  • Evaluate assignment operations: This is essentially syntactic sugar for modifying portions of Array with another Array using a combination of Sequences and/or Array objects. Full examples for this use case are provided in the tutorials book

AltStyle によって変換されたページ (->オリジナル) /