#![allow(unused_parens)] #![allow(non_snake_case)] use arrayfire; use RayBNN_DataLoader; use RayBNN_Graph; use RayBNN_Neural; use RayBNN_Optimizer; use std::collections::HashMap; use nohash_hasher; const BACK_END: arrayfire::Backend = arrayfire::Backend::CUDA; const DEVICE: i32 = 0; #[test] fn test_backstate_batch55() { arrayfire::set_backend(BACK_END); arrayfire::set_device(DEVICE); let rand_seed = 4324; arrayfire::set_seed(rand_seed); let neuron_size: u64 = 20; let input_size: u64 = 6; let output_size: u64 = 5; let proc_num: u64 = 2; //let active_size: u64 = 25; //let space_dims: u64 = 3; //let sim_steps: u64 = 100; let mut batch_size: u64 = 4; //let dataset_size: u64 = 70000; //let train_size: u64 = 60000; //let test_size: u64 = 10000; //let mut netdata = clusterdiffeq::neural::network_f64::create_nullnetdata(); let temp_dims = arrayfire::Dim4::new(&[1,1,1,1]); //let mut glia_pos = arrayfire::constant::(0.0,temp_dims); //let mut neuron_pos = arrayfire::constant::(0.0,temp_dims); /* netdata.input_size = input_size; netdata.output_size = output_size; netdata.neuron_size = neuron_size; netdata.proc_num = proc_num; netdata.active_size = neuron_size; netdata.batch_size = batch_size; */ let mut modeldata_string: HashMap = HashMap::new(); let mut modeldata_int: HashMap = HashMap::new(); modeldata_int.insert("neuron_size".to_string(), neuron_size); modeldata_int.insert("input_size".to_string(), input_size); modeldata_int.insert("output_size".to_string(), output_size); modeldata_int.insert("proc_num".to_string(), proc_num); modeldata_int.insert("active_size".to_string(), neuron_size); //modeldata_int.insert("space_dims".to_string(), space_dims); //modeldata_int.insert("step_num".to_string(), sim_steps); modeldata_int.insert("batch_size".to_string(), batch_size); let mut modeldata_float: HashMap = HashMap::new(); modeldata_float.insert("time_step".to_string(), 0.1); modeldata_float.insert("nratio".to_string(), 0.5); modeldata_float.insert("neuron_std".to_string(), 0.06); modeldata_float.insert("sphere_rad".to_string(), 0.9); modeldata_float.insert("neuron_rad".to_string(), 0.1); modeldata_float.insert("con_rad".to_string(), 0.6); modeldata_float.insert("init_prob".to_string(), 0.5); modeldata_float.insert("add_neuron_rate".to_string(), 0.0); modeldata_float.insert("del_neuron_rate".to_string(), 0.0); //let mut H = arrayfire::constant::(0.0,temp_dims); //let mut A = arrayfire::constant::(0.0,temp_dims); //let mut B = arrayfire::constant::(0.0,temp_dims); //let mut C = arrayfire::constant::(0.0,temp_dims); //let mut D = arrayfire::constant::(0.0,temp_dims); //let mut E = arrayfire::constant::(0.0,temp_dims); let mut neuron_idx = arrayfire::constant::(0,temp_dims); let N_dims = arrayfire::Dim4::new(&[neuron_size ,1,1,1]); let repeat_dims = arrayfire::Dim4::new(&[1,1,1,1]); //let L_dims = arrayfire::Dim4::new(&[output_size,1,1,1]); neuron_idx = arrayfire::iota::(N_dims,repeat_dims); //let last_neurons = arrayfire::iota::(L_dims,repeat_dims) + ((neuron_size-output_size) as i32 ); //neuron_idx = arrayfire::join(0, &neuron_idx, &last_neurons); //let mut WValues = arrayfire::constant::(0.0,temp_dims); //let mut WRowIdxCSR = arrayfire::constant::(0,temp_dims); //let mut WColIdx = arrayfire::constant::(0,temp_dims); let tile_dims = arrayfire::Dim4::new(&[1,batch_size,1,1]); let X_cpu: Vec = vec![0.263700,0.295200,-0.728400,0.834900,-0.619800,-0.310400, 0.052100,0.370600,0.671300,0.307500,-0.926000,-0.639700, 0.503200,-0.781500,-0.027800,-0.000300,0.314200,-0.528200, -0.645800,-0.899400,0.141500,-0.358300,-0.291600,-0.965600,]; let mut train_X = arrayfire::Array::new(&X_cpu, arrayfire::Dim4::new(&[input_size, batch_size, 1, 1])); //train_X = arrayfire::tile(&train_X, tile_dims); //arrayfire::print_gen("X".to_string(), &train_X,Some(6)); let Y_cpu: Vec = vec![-0.042500,-0.260800,0.417500,-0.972800,0.230200]; let mut Y = arrayfire::Array::new(&Y_cpu, arrayfire::Dim4::new(&[Y_cpu.len() as u64, 1, 1, 1])); Y = arrayfire::tile(&Y, tile_dims); let A_cpu: Vec = vec![-0.172100,-0.183100,-0.208500,-0.101300,-0.068700,-0.147900,-0.035200,-0.091000,-0.172000,-0.191700,-0.124300,-0.200900,-0.238200,-0.148800,-0.219900,-0.206900,-0.181000,-0.096800,-0.148600,-0.005400, ]; let mut A = arrayfire::Array::new(&A_cpu, arrayfire::Dim4::new(&[A_cpu.len() as u64, 1, 1, 1])); let B_cpu: Vec = vec![2.433300,-10.346700,2.327200,6.903200,8.113400,-2.301700,-0.113800,-6.599900,2.394600,4.002600,-2.593300,-10.030200,-9.371200,-2.105800,10.471700,11.880500,2.829900,10.013500,0.572900,-10.936300, ]; let mut B = arrayfire::Array::new(&B_cpu, arrayfire::Dim4::new(&[B_cpu.len() as u64, 1, 1, 1])); let C_cpu: Vec = vec![-1.871100,-1.439800,0.597400,-1.363600,-1.955700,0.398700,1.063500,-0.672400,1.574200,-0.089300,-1.493700,1.529400,0.764700,-0.250000,0.525600,1.107200,-0.969500,-1.222000,0.729700,1.815500, ]; let mut C = arrayfire::Array::new(&C_cpu, arrayfire::Dim4::new(&[C_cpu.len() as u64, 1, 1, 1])); let D_cpu: Vec = vec![-0.171100,-0.206600,-0.172900,-0.073200,-0.107800,-0.176100,-0.112000,-0.174700,-0.230300,-0.016000,-0.015600,-0.030900,-0.113000,-0.019500,-0.029900,-0.051300,-0.103500,-0.196000,-0.013400,-0.122100, ]; let mut D = arrayfire::Array::new(&D_cpu, arrayfire::Dim4::new(&[D_cpu.len() as u64, 1, 1, 1])); let E_cpu: Vec = vec![-0.721100,-0.434500,0.895100,0.375900,-0.322200,0.762100,-0.131100,0.762900,0.395100,-0.579600,-0.572600,0.091100,-0.678000,-0.283700,0.612900,-0.067200,0.282800,0.052900,-0.480400,0.662100, ]; let mut E = arrayfire::Array::new(&E_cpu, arrayfire::Dim4::new(&[E_cpu.len() as u64, 1, 1, 1])); let H_cpu: Vec = vec![-0.635200,0.663500,-0.600000,0.084600,0.279600,-0.084200,-0.979000,0.279800,0.888600,0.205700,0.332300,-0.955100,-0.222700,0.006500,0.594000,0.703000,-0.816900,-0.361300,-0.328500,0.024600, ]; let mut H = arrayfire::Array::new(&H_cpu, arrayfire::Dim4::new(&[H_cpu.len() as u64, 1, 1, 1])); let W_cpu: Vec = vec![0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.893800,0.000000,-0.304300,0.000000,0.404600,-0.000000,0.000000,-0.000000,0.000000,0.000000,0.177700,0.437700,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.000000,-0.287300,0.640400,-0.988600,-0.000000,-0.000000,-0.852600,-0.000000,0.747900,-0.281300,-0.944700,-0.743700,0.000000,-0.449800,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.581500,0.008000,0.412600,-0.000000,0.853800,-0.000000,-0.611500,-0.000000,-0.000000,0.000000,0.000000,-0.354800,-0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.000000,0.110500,-0.570200,-0.122800,-0.929400,0.158800,-0.000000,0.000000,0.000000,-0.155100,-0.000000,-0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.183800,-0.856500,-0.000000,0.501300,0.988100,-0.000000,0.000000,0.000000,-0.000000,-0.000000,-0.000000,0.000000,0.790200,-0.613700,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.513600,0.000000,0.000000,0.000000,-0.000000,-0.103200,0.000000,-0.000000,0.722500,-0.000000,0.622200,0.566800,0.141000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.089800,0.000000,-0.000000,-0.564100,0.906700,-0.469800,-0.000000,0.000000,-0.505700,-0.000000,0.023600,-0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.112600,0.000000,0.232800,-0.791000,-0.806400,0.276200,0.510700,0.000000,-0.000000,-0.000000,0.627900,0.926200,-0.826400,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.206600,0.431500,0.000000,-0.000000,0.000000,0.779000,0.823900,-0.000000,0.053600,0.000000,0.005400,-0.000000,0.000000,-0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.616600,-0.000000,-0.000000,0.647700,-0.299900,0.828400,0.142100,0.000000,0.699800,-0.000000,0.675000,0.000000,0.830000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.000000,0.896600,0.000000,-0.630800,-0.000000,-0.323300,-0.097900,-0.604200,-0.676500,-0.000000,-0.000000,-0.000000,0.000000,-0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.603700,-0.656800,0.000000,-0.411300,0.000000,-0.000000,0.728700,0.000000,0.942000,-0.000000,0.077700,-0.209100,-0.157000,-0.057900,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.898700,0.218300,0.534700,-0.000000,-0.173900,-0.000000,-0.000000,0.000000,0.000000,-0.850800,0.000000,-0.000000,0.000000,-0.395200,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-0.517900,0.219100,-0.027500,-0.000000,-0.000000,0.000000,-0.053000,0.000000,0.748700,-0.000000,0.000000,0.714400,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.470500,-0.604000,0.000000,-0.532800,0.000000,-0.654700,0.161200,-0.300300,0.000000,-0.000000,0.209400,0.332400,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,]; let mut W = arrayfire::Array::new(&W_cpu, arrayfire::Dim4::new(&[neuron_size, neuron_size, 1, 1])); let denseW = W.clone(); W = arrayfire::sparse_from_dense(&W, arrayfire::SparseFormat::CSR); //arrayfire::print_gen("W".to_string(), &W, Some(6)); let mut WValues = arrayfire::sparse_get_values(&W); let mut WRowIdxCSR = arrayfire::sparse_get_row_indices(&W); let mut WColIdx = arrayfire::sparse_get_col_indices(&W); let Z_dims = arrayfire::Dim4::new(&[neuron_size,batch_size,proc_num,1]); let mut Z = arrayfire::constant::(0.0,Z_dims); let mut Q = arrayfire::constant::(0.0,Z_dims); //let mut alpha0: f64 = 0.0091; //let mut alpha1: f64 = alpha0; let active_size = neuron_idx.dims()[0]; let idxsel = arrayfire::rows(&neuron_idx, (active_size-output_size) as i64, (active_size-1) as i64); let Qslices: u64 = Q.dims()[2]; let mut WRowIdxCOO = RayBNN_Sparse::Util::Convert::CSR_to_COO(&WRowIdxCSR); let total_param_size = WValues.dims()[0] + H.dims()[0] + A.dims()[0] + B.dims()[0] + C.dims()[0] + D.dims()[0] + E.dims()[0] ; let mt_dims = arrayfire::Dim4::new(&[total_param_size,1,1,1]); let mut mt = arrayfire::constant::(0.0,mt_dims); let mut vt = arrayfire::constant::(0.0,mt_dims); let mut grad = arrayfire::constant::(0.0,mt_dims); let X_dims = arrayfire::Dim4::new(&[input_size,batch_size,proc_num,1]); let mut X = arrayfire::constant::(0.0,X_dims); let mut idxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut valsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut cvec_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut dXsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut nrows_out: nohash_hasher::IntMap = nohash_hasher::IntMap::default(); let mut sparseval_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut sparsecol_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut sparserow_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); arrayfire::sync(DEVICE); let mut Wseqs = [arrayfire::Seq::default()]; let mut Hseqs = [arrayfire::Seq::default()]; let mut Aseqs = [arrayfire::Seq::default()]; let mut Bseqs = [arrayfire::Seq::default()]; let mut Cseqs = [arrayfire::Seq::default()]; let mut Dseqs = [arrayfire::Seq::default()]; let mut Eseqs = [arrayfire::Seq::default()]; let mut Hidxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut Aidxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut Bidxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut Cidxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut Didxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut Eidxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut combidxsel_out: nohash_hasher::IntMap > = nohash_hasher::IntMap::default(); let mut dAseqs_out: nohash_hasher::IntMap; 2] > = nohash_hasher::IntMap::default(); let mut dBseqs_out: nohash_hasher::IntMap; 2] > = nohash_hasher::IntMap::default(); let mut dCseqs_out: nohash_hasher::IntMap; 2] > = nohash_hasher::IntMap::default(); let mut dDseqs_out: nohash_hasher::IntMap; 2] > = nohash_hasher::IntMap::default(); let mut dEseqs_out: nohash_hasher::IntMap; 2] > = nohash_hasher::IntMap::default(); RayBNN_Neural::Network::Neurons::find_path_backward_group2( //&netdata, &modeldata_int, proc_num, 1, &WRowIdxCOO, &WColIdx, &neuron_idx, WValues.dims()[0], H.dims()[0], A.dims()[0], B.dims()[0], C.dims()[0], D.dims()[0], E.dims()[0], &mut idxsel_out, &mut valsel_out, &mut cvec_out, &mut dXsel_out, &mut nrows_out, &mut sparseval_out, &mut sparserow_out, &mut sparsecol_out, &mut Hidxsel_out, &mut Aidxsel_out, &mut Bidxsel_out, &mut Cidxsel_out, &mut Didxsel_out, &mut Eidxsel_out, &mut combidxsel_out, &mut dAseqs_out, &mut dBseqs_out, &mut dCseqs_out, &mut dDseqs_out, &mut dEseqs_out, &mut Wseqs, &mut Hseqs, &mut Aseqs, &mut Bseqs, &mut Cseqs, &mut Dseqs, &mut Eseqs ); //let train_X_dims = arrayfire::Dim4::new(&[input_size,batch_size,1,1]); //let mut train_X = arrayfire::constant::(0.0,temp_dims); //let Y_dims = arrayfire::Dim4::new(&[output_size,batch_size,1,1]); //let mut Y = arrayfire::constant::(0.0,temp_dims); //let mut batch_idx = 0; //let epoch_num = (train_size/batch_size); let mut network_params = arrayfire::constant::(0.0,mt_dims); arrayfire::assign_seq(&mut network_params, &Wseqs, &WValues); arrayfire::assign_seq(&mut network_params, &Hseqs, &H); arrayfire::assign_seq(&mut network_params, &Aseqs, &A); arrayfire::assign_seq(&mut network_params, &Bseqs, &B); arrayfire::assign_seq(&mut network_params, &Cseqs, &C); arrayfire::assign_seq(&mut network_params, &Dseqs, &D); arrayfire::assign_seq(&mut network_params, &Eseqs, &E); arrayfire::device_gc(); arrayfire::sync(DEVICE); //batch_idx = i % epoch_num; //train_X = arrayfire::Array::new(&MNISTXX[&batch_idx], train_X_dims); //Y = arrayfire::Array::new(&MNISTY[&batch_idx], Y_dims); arrayfire::set_slice(&mut X, &train_X, 0); //println!("a1"); RayBNN_Neural::Network::Neurons::state_space_forward_batch( //&netdata, &modeldata_int, &X, &WRowIdxCSR, &WColIdx, &Wseqs, &Hseqs, &Aseqs, &Bseqs, &Cseqs, &Dseqs, &Eseqs, &network_params, &mut Z, &mut Q ); //println!("a2"); RayBNN_Neural::Network::Neurons::state_space_backward_group2( //&netdata, &modeldata_int, &X, &network_params, &Z, &Q, &Y, RayBNN_Optimizer::Continuous::Loss::MSE_grad, &neuron_idx, &idxsel_out, &valsel_out, &cvec_out, &dXsel_out, &nrows_out, &sparseval_out, &sparserow_out, &sparsecol_out, &Hidxsel_out, &Aidxsel_out, &Bidxsel_out, &Cidxsel_out, &Didxsel_out, &Eidxsel_out, &combidxsel_out, &dAseqs_out, &dBseqs_out, &dCseqs_out, &dDseqs_out, &dEseqs_out, &mut grad, ); let gW = arrayfire::index(&grad, &Wseqs); let mut densegW = arrayfire::sparse( neuron_size, neuron_size, &gW, &WRowIdxCOO, &WColIdx, arrayfire::SparseFormat::COO ); densegW = arrayfire::sparse_to_dense(&densegW); //arrayfire::print_gen("densegW".to_string(), &densegW, Some(9)); let gW_act_cpu: Vec = vec![0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.002210836591,0.042095616169,0.000001583667,-0.001442041826,0.000000000000,0.001258210933,0.002832970691,0.013912739964,0.001003553993,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.002474929699,0.047124102742,0.000001772842,-0.001614299382,0.000000000000,0.001408509168,0.003171380159,0.015574671359,0.001123432457,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.006106838728,-0.116277765709,-0.000004374451,0.003983250914,0.000000000000,-0.003475467743,-0.007825316083,-0.038430185020,-0.002772046752,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.006999724951,0.133278839361,0.000005014044,-0.004565645508,0.000000000000,0.003983618916,0.008969462380,0.044049095927,0.003177350129,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.005196346298,-0.098941459619,-0.000003722247,0.003389372483,0.000000000000,-0.002957296687,-0.006658609155,-0.032700478687,-0.002358751479,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.002602365103,-0.049550547057,-0.000001864126,0.001697420488,0.000000000000,-0.001481034030,-0.003334676156,-0.016376619207,-0.001181278572,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.026261622081,0.006471526806,0.219652349093,0.028031665004,-0.001243964216,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.040878516027,-0.010073498562,-0.341908129094,-0.043633742942,0.001936339309,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.017448600589,0.004299775775,0.145940189674,0.018624642643,-0.000826507772,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.040595514161,0.010003759756,0.339541099954,0.043331666647,-0.001922934037,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.021481270441,0.005293527455,0.179669462126,0.022929115917,-0.001017527846,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.021708742827,0.005349582394,0.181572042393,0.023171920025,-0.001028302790,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.060391021741,-0.014881872675,-0.505110832398,-0.064461398670,0.002860610430,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.007060846077,0.001739970765,0.059056954766,0.007536749682,-0.000334459152,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.007577842919,0.001867371841,0.063381119153,0.008088592301,-0.000358948331,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.046934082726,0.011565743104,0.392556921711,0.050097457049,-0.002223180246,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.024751879335,0.006099488071,0.207024852598,0.026420165045,-0.001172450509,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.088517965555,0.021813061856,0.740364742548,0.094484108773,-0.004192931469,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.025956641866,0.006396371980,0.217101492926,0.027706129011,-0.001229517871,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.049118537721,-0.012104047974,-0.410827715100,-0.052429145109,0.002326653818,]; let mut gW_act = arrayfire::Array::new(&gW_act_cpu, arrayfire::Dim4::new(&[neuron_size, neuron_size, 1, 1])); let gW_act_cpu2: Vec = vec![0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000376263425,0.007450802359,0.000000011811,0.000364307177,0.000000000000,0.006198071647,0.000938465226,-0.000597346169,0.000168082022,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.002676453458,0.052999373400,0.000000084016,0.002591405751,0.000000000000,0.044088394482,0.006675531913,-0.004249068913,0.001195608391,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.004848092839,0.096002372810,0.000000152186,0.004694038534,0.000000000000,0.079861141974,0.012091971325,-0.007696707936,0.002165709425,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.002220748619,0.043975464977,0.000000069711,0.002150181512,0.000000000000,0.036581708859,0.005538926236,-0.003525603591,0.000992038803,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.006687522670,-0.132426928679,-0.000000209928,-0.006475018148,0.000000000000,-0.110161503751,-0.016679823397,0.010616939594,-0.002987407907,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.004619879322,-0.091483268117,-0.000000145023,-0.004473076792,0.000000000000,-0.076101850917,-0.011522767848,0.007334402007,-0.002063763324,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.028610930718,0.000273889777,0.256681745869,0.029120335229,-0.001074495568,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.059891629659,-0.000573336997,-0.537315203592,-0.060957972681,0.002249255408,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.017090509916,0.000163605861,0.153326781512,0.017394798614,-0.000641841307,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.039823262386,0.000381224384,0.357272701681,0.040532297324,-0.001495579412,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.028273635711,0.000270660883,0.253655718083,0.028777034839,-0.001061828312,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.058669969655,-0.000561642159,-0.526355132913,-0.059714561580,0.002203375452,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.056600572745,-0.000541832015,-0.507789626717,-0.057608320007,0.002125658378,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.003842534171,0.000036784222,0.034473131591,0.003910948731,-0.000144307991,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.007124402518,0.000068201242,0.063916273628,0.007251249240,-0.000267559941,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.045917997960,0.000439568721,0.411951362202,0.046735546873,-0.001724469777,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.026630975866,0.000254935853,0.238918665272,0.027105128188,-0.001000137529,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.092357411271,0.000884128902,0.828580580005,0.094001792658,-0.003468521527,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.041146637325,0.000393892930,0.369145303561,0.041879234348,-0.001545279316,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.044316442137,-0.000424237176,-0.397583072371,-0.045105476082,0.001664322673,]; let mut gW_act2 = arrayfire::Array::new(&gW_act_cpu2, arrayfire::Dim4::new(&[neuron_size, neuron_size, 1, 1])); let gW_act_cpu3: Vec = vec![0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.002615892331,0.081016874736,0.000001252313,0.013483515293,0.000000000000,0.075543905110,-0.013598973232,0.012344118550,-0.001688638527,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.004062638825,-0.125824100966,-0.000001944918,-0.020940713835,0.000000000000,-0.117324248497,0.021120026989,-0.019171161857,0.002622557648,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.000144518694,-0.004475892523,-0.000000069186,-0.000744915988,0.000000000000,-0.004173530529,0.000751294626,-0.000681968394,0.000093291238,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.000001559554,-0.000048300998,-0.000000000747,-0.000008038662,0.000000000000,-0.000045038099,0.000008107496,-0.000007359371,0.000001006740,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.001633373153,0.050587245711,0.000000781949,0.008419158397,0.000000000000,0.047169902595,-0.008491250774,0.007707714722,-0.001054392339,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.002745855186,-0.085041957940,-0.000001314531,-0.014153403772,0.000000000000,-0.079297080046,0.014274597896,-0.012957399479,0.001772533525,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.030658650996,0.001072648430,0.304276076397,0.033153669766,-0.001225520218,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.054908859832,-0.001921085905,-0.544950670906,-0.059377374640,0.002194875367,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.006560240893,0.000229521909,0.065108029686,0.007094117096,-0.000262232929,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.041407584760,0.001448719345,0.410955375226,0.044777357984,-0.001655188035,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.029891662942,0.001045813964,0.296663996024,0.032324263781,-0.001194861355,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.046849560953,-0.001639116738,-0.464965030251,-0.050662205351,0.001872720498,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.047605589803,-0.001665567777,-0.472468344471,-0.051479760266,0.001902941287,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.004013858430,0.000140432107,0.039836100238,0.004340508553,-0.000160446220,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.006636650922,0.000232195252,0.065866371718,0.007176745416,-0.000265287272,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.043872736837,0.001534967155,0.435421122329,0.047443125565,-0.001753727717,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.006418650948,0.000224568128,0.063702800438,0.006941004478,-0.000256573145,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.071571711073,0.002504065934,0.710323472133,0.077396258362,-0.002860940586,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.022190813520,0.000776385800,0.220235837212,0.023996714773,-0.000887034809,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.046856451380,-0.001639357812,-0.465033415255,-0.050669656524,0.001872995929,]; let mut gW_act3 = arrayfire::Array::new(&gW_act_cpu3, arrayfire::Dim4::new(&[neuron_size, neuron_size, 1, 1])); let gW_act_cpu4: Vec = vec![0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.002888945888,-0.022771390209,-0.000000763694,-0.017294354498,0.000000000000,-0.083243881203,0.018286923229,-0.009512199194,0.003872041864,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.004023409618,-0.031713515568,-0.000001063590,-0.024085695936,0.000000000000,-0.115933023776,0.025468037708,-0.013247556450,0.005392558768,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000632991395,0.004989395656,0.000000167332,0.003789332861,0.000000000000,0.018239407232,-0.004006812693,0.002084199731,-0.000848395670,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.001602832629,-0.012633925537,-0.000000423710,-0.009595179958,0.000000000000,-0.046185014920,0.010145872705,-0.005277517763,0.002148269743,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.001304454353,-0.010282033733,-0.000000344833,-0.007808971464,0.000000000000,-0.037587357942,0.008257148983,-0.004295071671,0.001748354610,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.004319551176,-0.034047776998,-0.000001141876,-0.025858514560,0.000000000000,-0.124466230551,0.027342603081,-0.014222637878,0.005789476035,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.031973391967,0.000748221063,0.301795589867,0.027944959354,-0.001257402587,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.061869146276,-0.001447822565,-0.583980439559,-0.054074049439,0.002433098893,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.005145036141,0.000120400876,0.048563793880,0.004496796148,-0.000202336423,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.042155851120,0.000986504521,0.397907421529,0.036844497053,-0.001657843382,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.015938320721,0.000372978484,0.150441182735,0.013930199373,-0.000626798862,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.049515809423,-0.001158737602,-0.467377778626,-0.043277150049,0.001947285010,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.045174262435,-0.001057139470,-0.426398087278,-0.039482608818,0.001776547028,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.003641033204,0.000085205152,0.034367569281,0.003182287478,-0.000143189205,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.007324657944,0.000171407005,0.069137158397,0.006401800245,-0.000288053387,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.042987798979,0.001005973238,0.405760144667,0.037571625070,-0.001690561005,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.007598870546,0.000177823954,0.071725440361,0.006641463901,-0.000298837217,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.073902597178,0.001729421760,0.697563709568,0.064591366360,-0.002906332772,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.031902472858,0.000746561459,0.301126187182,0.027882975576,-0.001254613585,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,0.000000000000,-0.035706598395,-0.000835583194,-0.337033178581,-0.031207806849,0.001404216645,]; let mut gW_act4 = arrayfire::Array::new(&gW_act_cpu4, arrayfire::Dim4::new(&[neuron_size, neuron_size, 1, 1])); gW_act = (gW_act + gW_act2 + gW_act3 + gW_act4)/4.0; //arrayfire::print_gen("gW_act".to_string(), &gW_act, Some(9)); let zeros_dims = arrayfire::Dim4::new(&[neuron_size,neuron_size,1,1]); let mut zeros = arrayfire::constant::(0.0,zeros_dims); let mut ones = arrayfire::neq(&denseW,&zeros, true); gW_act = arrayfire::mul(&ones, &gW_act, false); //arrayfire::print_gen("gW_act".to_string(), &gW_act, Some(9)); let mut densegW_cpu = vec!(f64::default();densegW.elements()); densegW.host(&mut densegW_cpu); densegW_cpu = RayBNN_DataLoader::Dataset::Round::rvector(&densegW_cpu, 9); let mut gW_cpu = vec!(f64::default();gW_act.elements()); gW_act.host(&mut gW_cpu); gW_cpu = RayBNN_DataLoader::Dataset::Round::rvector(&gW_cpu, 9); assert_eq!(gW_cpu,densegW_cpu); }