logo

Function neuronika::from_ndarray[][src]

pub fn from_ndarray<D: Dimension>(array: Array<f32, D>) -> Var<Input<D>>
Expand description

Creates a variable from a ndarray array that owns its data.

Examples

use ndarray;
use neuronika;

let a = ndarray::array![[1., 2.], [3.,4.]];
let t = neuronika::from_ndarray(a.clone());

assert_eq!(*t.data(), a);