Skip to content

Commit

Permalink
minimize diff
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Jul 19, 2024
1 parent 7c0ea98 commit 8bc947d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fidget/src/core/eval/test/grad_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ impl<F: Function + MathFunction> TestGradSlice<F> {
let mut eval = F::new_grad_slice_eval();

for i in 0..3 {
let args_g = args
let args = args
.iter()
.map(|&v| match i {
0 => Grad::new(v, 1.0, 0.0, 0.0),
Expand All @@ -401,9 +401,8 @@ impl<F: Function + MathFunction> TestGradSlice<F> {
_ => unreachable!(),
})
.collect::<Vec<Grad>>();
let out = eval.eval(&tape, &[args_g.as_slice()]).unwrap();

for (a, &o) in args_g.iter().zip(out.iter()) {
let out = eval.eval(&tape, &[args.as_slice()]).unwrap();
for (a, &o) in args.iter().zip(out.iter()) {
let v = C::eval_f64(a.v as f64);
let err = (v as f32 - o.v).abs();
let err_frac = err / (v.abs() as f32).max(o.v.abs());
Expand Down

0 comments on commit 8bc947d

Please sign in to comment.