Skip to content

Commit

Permalink
Fix the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Oct 21, 2021
1 parent 99c1407 commit 0a0e357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn gradient_descent() {
// Dummy mini-batches made of zeros.
let xs = Tensor::zeros(&[7], kind::FLOAT_CPU);
let ys = Tensor::zeros(&[7], kind::FLOAT_CPU);
let loss = (my_module.forward(&xs) - ys).pow(2).sum(kind::Kind::Float);
let loss = (my_module.forward(&xs) - ys).pow_tensor_scalar(2).sum(kind::Kind::Float);
opt.backward_step(&loss);
}
}
Expand Down

0 comments on commit 0a0e357

Please sign in to comment.