maciejkula / rustlearn

Machine learning crate for Rust
Apache License 2.0
619 stars 53 forks source link

Try to keep consistent in Array::from() method #21

Closed libratiger closed 2 years ago

libratiger commented 8 years ago

when the input is a Vec<f32> or a Vec<Vec<f32>>, one uses move, the another uses reference, this is not consistent.

This is for performance, but make this clearly in docs is better.

let array = Array::from(vec![0.0, 1.0, 2.0, 3.0]);
let array = Array::from(&vec![vec![0.0, 1.0],
                              vec![2.0, 3.0]]);
maciejkula commented 8 years ago

Can you please make a PR for the docs?