Skip to content

Commit f8ca4a1

Browse files
committed
refactor: bypass incorrect original type ordering in constructor
1 parent b05286d commit f8ca4a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ext/ADTypesConstructionBaseExt.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ module ADTypesConstructionBaseExt
33
using ADTypes: AutoEnzyme, AutoForwardDiff, AutoPolyesterForwardDiff
44
using ConstructionBase: ConstructionBase
55

6+
struct InternalAutoEnzymeReconstructor{A} end
7+
8+
InternalAutoEnzymeReconstructor{A}(mode::M) where {M, A} = AutoEnzyme{M, A}(mode)
9+
610
function ConstructionBase.constructorof(::Type{<:AutoEnzyme{M, A}}) where {M, A}
7-
return AutoEnzyme{A}
11+
return InternalAutoEnzymeReconstructor{A}
812
end
913

1014
function ConstructionBase.constructorof(::Type{<:AutoForwardDiff{chunksize}}) where {chunksize}

src/dense.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ struct AutoEnzyme{M, A} <: AbstractADType
6767
mode::M
6868
end
6969

70-
AutoEnzyme{A}(mode::M) where {M, A} = AutoEnzyme{M, A}(mode)
71-
7270
function AutoEnzyme(;
7371
mode::M = nothing, function_annotation::Type{A} = Nothing) where {M, A}
7472
return AutoEnzyme{A}(mode)

0 commit comments

Comments
 (0)