|
1 |
| -using AbstractDifferentiation, Diffractor, Test |
2 |
| -include(joinpath(pathof(AbstractDifferentiation), "..", "..", "test", "test_utils.jl")) |
| 1 | +using AbstractDifferentiation, Diffractor, Test, LinearAlgebra |
3 | 2 | import AbstractDifferentiation as AD
|
4 |
| - |
5 | 3 | backend = Diffractor.DiffractorForwardBackend()
|
| 4 | + |
| 5 | +@testset "basics" begin |
| 6 | + @test AD.derivative(backend, +, 1.5, 10.0) == (1.0, 1.0) |
| 7 | + @test AD.derivative(backend, *, 1.5, 10.0) == (10.0, 1.5) |
| 8 | + @test only(AD.jacobian(backend, prod, [1.5, 2.5, 10.0])) == [25.0 15.0 3.75] |
| 9 | + @test only(AD.jacobian(backend, identity, [1.5, 2.5, 10.0])) == Matrix(I, 3, 3) |
| 10 | +end |
| 11 | + |
| 12 | +# standard tests from AbstractDifferentiation.test_utils |
| 13 | +include(joinpath(pathof(AbstractDifferentiation), "..", "..", "test", "test_utils.jl")) |
6 | 14 | @testset "ForwardDiffBackend" begin
|
7 | 15 | backends = [
|
8 | 16 | @inferred(Diffractor.DiffractorForwardBackend())
|
@@ -34,8 +42,8 @@ backend = Diffractor.DiffractorForwardBackend()
|
34 | 42 | @testset "Lazy Gradient" begin #Diffractor.TangentBundle{1, Float64, Diffractor.TaylorTangent{Tuple{Float64}}}(::Float64, ::Tuple{Float64})
|
35 | 43 | @test_broken test_lazy_gradients(backend)
|
36 | 44 | end
|
37 |
| - @testset "Lazy Jacobian" begin |
38 |
| - test_lazy_jacobians(backend; vaugmented=true) |
| 45 | + @testset "Lazy Jacobian" begin #MethodError: no method matching *(::Diffractor.PrimeDerivativeBack{1, Diagonal{Bool, Vector{Bool}}}, ::Vector{Float64}) |
| 46 | + @test_broken test_lazy_jacobians(backend; vaugmented=true) |
39 | 47 | end
|
40 | 48 | @testset "Lazy Hessian" begin # everything everywhere all at once is broken
|
41 | 49 | @test_broken test_lazy_hessians(backend)
|
|
0 commit comments