16
16
17
17
@testset " simple" begin
18
18
19
- if Tullio. _GRAD[] != :Dual || VERSION >= v " 1.5" # These 3 give errors on Julia 1.4, LV 0.8, I have no idea why.
20
-
21
19
@test _gradient (x -> sum (@tullio y[i] := 2 * x[i]), rand (3 ))[1 ] == [2 ,2 ,2 ]
22
20
@test _gradient (x -> sum (@tullio y[i] := 2 * x[i] + i), rand (3 ))[1 ] == [2 ,2 ,2 ]
23
21
@@ -32,7 +30,6 @@ if Tullio._GRAD[] != :Dual || VERSION >= v"1.5" # These 3 give errors on Julia 1
32
30
g_fd = ForwardDiff. gradient (x -> sum (sin, g2 (x)), r100)
33
31
@test g_fd ≈ _gradient (x -> sum (sin, g2 (x)), r100)[1 ]
34
32
35
- end
36
33
r100 = randn (100 )
37
34
38
35
# scalar output
216
213
@test gradtest (con14, (3 ,3 ,9 ,9 ))
217
214
218
215
# # scalar -- one with :=, one without
219
- sc1 (x) = @tullio s = r22[b,β] * x[a,b,c] * r312[c,a,β]
220
- @test gradtest (sc1, (1 ,2 ,3 ))
216
+ sc1 (x) = @tullio s = r22[b,β] * x[a,b,c] * r312[c,a,β] avx = false
217
+ @test gradtest (sc1, (1 ,2 ,3 )) # UndefVarError: ####op#798_0 not defined
221
218
222
219
sc2 (x) = @tullio s := x[γ,c] * r3399[c,γ,i,i]
223
220
@test gradtest (sc2, (3 ,3 ))
0 commit comments