Skip to content

Commit 894ee3c

Browse files
authored
Merge pull request #255 from MasonProtter/main
Update to new AbstractDifferentiation.jl
2 parents 912dd80 + bfe284d commit 894ee3c

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1616
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
1717

1818
[compat]
19-
AbstractDifferentiation = "0.5"
19+
AbstractDifferentiation = "0.5, 0.6"
2020
ChainRules = "1.44.6"
2121
ChainRulesCore = "1.20"
2222
Combinatorics = "1"

test/AbstractDifferentiationTests.jl

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module AbstractDifferentiationTests
2+
13
using AbstractDifferentiation, Diffractor, Test, LinearAlgebra, ChainRulesCore
24
import AbstractDifferentiation as AD
35
backend = Diffractor.DiffractorForwardBackend()
@@ -36,36 +38,37 @@ include(joinpath(pathof(AbstractDifferentiation), "..", "..", "test", "test_util
3638
@testset for backend in backends
3739
@test backend isa AD.AbstractForwardMode
3840

39-
@testset "Derivative" begin #setfield!(::Core.Box, ::Symbol, ::Float64)
40-
@test_broken test_derivatives(backend)
41+
@testset "Derivative" begin
42+
test_derivatives(backend)
4143
end
42-
@testset "Gradient" begin #Diffractor.TangentBundle{1, Float64, Diffractor.TaylorTangent{Tuple{Float64}}}(::Float64, ::Tuple{Float64})
44+
@testset "Gradient" begin # no method matching size(::ZeroTangent)
4345
@test_broken test_gradients(backend)
4446
end
4547
@testset "Jacobian" begin #setfield!(::Core.Box, ::Symbol, ::Vector{Float64})
46-
@test_broken test_jacobians(backend)
48+
test_jacobians(backend)
4749
end
48-
@testset "Hessian" begin #setindex!(::ChainRulesCore.ZeroTangent, ::Float64, ::Int64)
50+
@testset "Hessian" begin # no method matching (Diffractor.TangentBundle{…} where P)(::Tuple{…}, ::Tuple{…})
4951
@test_broken test_hessians(backend)
5052
end
51-
@testset "jvp" begin #setfield!(::Core.Box, ::Symbol, ::Vector{Float64})
52-
@test_broken test_jvp(backend; vaugmented=true)
53+
@testset "jvp" begin # Expression: pf1[1] isa Vector{Float64}
54+
@test_broken false # test_jvp(backend; vaugmented=true)
5355
end
54-
@testset "j′vp" begin #setfield!(::Core.Box, ::Symbol, ::Vector{Float64})
55-
@test_broken test_j′vp(backend)
56+
@testset "j′vp" begin # no method matching *(::Diffractor.PrimeDerivativeBack{1, Diagonal{Bool, Vector{Bool}}}, ::Vector{Float64})
57+
@test_broken false #test_j′vp(backend)
5658
end
5759
@testset "Lazy Derivative" begin
5860
test_lazy_derivatives(backend)
5961
end
60-
@testset "Lazy Gradient" begin #Diffractor.TangentBundle{1, Float64, Diffractor.TaylorTangent{Tuple{Float64}}}(::Float64, ::Tuple{Float64})
62+
@testset "Lazy Gradient" begin #MethodError: no method matching size(::ZeroTangent)
6163
@test_broken test_lazy_gradients(backend)
6264
end
63-
@testset "Lazy Jacobian" begin #MethodError: no method matching *(::Diffractor.PrimeDerivativeBack{1, Diagonal{Bool, Vector{Bool}}}, ::Vector{Float64})
64-
@test_broken test_lazy_jacobians(backend; vaugmented=true)
65+
@testset "Lazy Jacobian" begin # no method matching *(::Diffractor.PrimeDerivativeBack{1, Diagonal{Bool, Vector{Bool}}}, ::Vector{Float64})
66+
@test_broken false #test_lazy_jacobians(backend)
6567
end
66-
@testset "Lazy Hessian" begin # everything everywhere all at once is broken
67-
@test_broken test_lazy_hessians(backend)
68+
@testset "Lazy Hessian" begin # ERROR: MethodError: no method matching *(::Vector{Float64}, ::Diffractor.PrimeDerivativeBack{1, Vector{Float64}})
69+
@test_broken false #test_lazy_hessians(backend)
6870
end
6971
end
7072
end
7173

74+
end #module AbstractDifferentiationTests

0 commit comments

Comments
 (0)