Skip to content

Commit

Permalink
fix(initializer): init shape (f_in, f_out)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewxs committed Jul 23, 2023
1 parent 812e3fa commit f47e866
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ impl Initializer {
/// Initializes a 2D tensor with random values based on the specified standard deviation.
fn initialize_data(f_in: usize, f_out: usize, std_dev: f64) -> Tensor2D {
let mut rng = rand::thread_rng();
let mut data = Vec::with_capacity(f_out);
for _ in 0..f_out {
let mut row = Vec::with_capacity(f_in);
for _ in 0..f_in {
let mut data = Vec::with_capacity(f_in);
for _ in 0..f_in {
let mut row = Vec::with_capacity(f_out);
for _ in 0..f_out {
row.push(rng.gen::<f64>() * std_dev);
}
data.push(row);
Expand Down

0 comments on commit f47e866

Please sign in to comment.