|
| 1 | +using AbstractDifferentiation, Diffractor, Test |
| 2 | +include(joinpath(pathof(AbstractDifferentiation), "..", "..", "test", "test_utils.jl")) |
| 3 | +import AbstractDifferentiation as AD |
| 4 | + |
| 5 | +backend = Diffractor.DiffractorForwardBackend() |
| 6 | +@testset "ForwardDiffBackend" begin |
| 7 | + backends = [ |
| 8 | + @inferred(Diffractor.DiffractorForwardBackend()) |
| 9 | + ] |
| 10 | + @testset for backend in backends |
| 11 | + @test backend isa AD.AbstractForwardMode |
| 12 | + |
| 13 | + @testset "Derivative" begin #setfield!(::Core.Box, ::Symbol, ::Float64) |
| 14 | + @test_broken test_derivatives(backend) |
| 15 | + end |
| 16 | + @testset "Gradient" begin #Diffractor.TangentBundle{1, Float64, Diffractor.TaylorTangent{Tuple{Float64}}}(::Float64, ::Tuple{Float64}) |
| 17 | + @test_broken test_gradients(backend) |
| 18 | + end |
| 19 | + @testset "Jacobian" begin #setfield!(::Core.Box, ::Symbol, ::Vector{Float64}) |
| 20 | + @test_broken test_jacobians(backend) |
| 21 | + end |
| 22 | + @testset "Hessian" begin #setindex!(::ChainRulesCore.ZeroTangent, ::Float64, ::Int64) |
| 23 | + @test_broken test_hessians(backend) |
| 24 | + end |
| 25 | + @testset "jvp" begin #setfield!(::Core.Box, ::Symbol, ::Vector{Float64}) |
| 26 | + @test_broken test_jvp(backend; vaugmented=true) |
| 27 | + end |
| 28 | + @testset "j′vp" begin #setfield!(::Core.Box, ::Symbol, ::Vector{Float64}) |
| 29 | + @test_broken test_j′vp(backend) |
| 30 | + end |
| 31 | + @testset "Lazy Derivative" begin |
| 32 | + test_lazy_derivatives(backend) |
| 33 | + end |
| 34 | + @testset "Lazy Gradient" begin #Diffractor.TangentBundle{1, Float64, Diffractor.TaylorTangent{Tuple{Float64}}}(::Float64, ::Tuple{Float64}) |
| 35 | + @test_broken test_lazy_gradients(backend) |
| 36 | + end |
| 37 | + @testset "Lazy Jacobian" begin |
| 38 | + test_lazy_jacobians(backend; vaugmented=true) |
| 39 | + end |
| 40 | + @testset "Lazy Hessian" begin # everything everywhere all at once is broken |
| 41 | + @test_broken test_lazy_hessians(backend) |
| 42 | + end |
| 43 | + end |
| 44 | +end |
0 commit comments