Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lecopivo committed Dec 6, 2023
1 parent fb87f83 commit 6975f5c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/for_loop_gradient.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ open SciLean
set_default_scalar Float

def foo :=
((gradient Float (fun x : Float ^ Idx 3 => Id.run do
((SciLean.gradient Float (fun x : Float ^ Idx 3 => Id.run do
let mut prod := 1
let mut sum := 0.0
for i in fullRange (Idx 3) do
prod := prod * x[i]
sum := sum + x[i]
(prod,sum)))
rewrite_by
unfold gradient
unfold SciLean.gradient
ftrans
ftrans
unfold gradient
unfold SciLean.gradient
ftrans)

/--
Expand All @@ -32,7 +32,7 @@ info: ⊞[0.000000, 0.000000, 0.000000]
#eval foo ⊞[6.0,7,8] (0,0)

def bar :=
((gradient Float (fun x : Float ^ Idx 3 => Id.run do
((SciLean.gradient Float (fun x : Float ^ Idx 3 => Id.run do
let mut prod := 1
let mut sum := 0.0
let mut norm2 := 0.0
Expand All @@ -43,10 +43,10 @@ def bar :=
norm2 := norm2 + x[i]*x[i]
(prod,sum,norm2)))
rewrite_by
unfold gradient
unfold SciLean.gradient
ftrans
ftrans
unfold gradient
unfold SciLean.gradient
ftrans)

/--
Expand Down

0 comments on commit 6975f5c

Please sign in to comment.