Skip to content

Commit c765d67

Browse files
committed
Codecov
1 parent f20ffe1 commit c765d67

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/utils.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ nanify(x::AbstractFloat) = convert(typeof(x), NaN)
2222
nanify(x::AbstractArray) = map(nanify, x)
2323
nanify(x::NamedTuple) = NamedTuple{keys(x)}(map(nanify, values(x)))
2424
nanify(x::Tuple) = map(nanify, x)
25-
nanify(::NoFData) = NoFData()
2625
nanify(::NoRData) = NoRData()
2726

2827
function nanify_fdata_and_rdata!!(contexts::Vararg{CoDual, C}) where {C}

DifferentiationInterface/src/misc/differentiate_with.jl

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,8 @@ struct DifferentiateWith{C, F, B <: AbstractADType, N <: NTuple{C, Any}}
7878
function DifferentiateWith(
7979
f::F,
8080
backend::B,
81-
context_wrappers::NTuple{C, Any},
81+
context_wrappers::NTuple{C, <:Union{Function, Type}},
8282
) where {F, B <: AbstractADType, C}
83-
for (i, wrapper) in pairs(context_wrappers)
84-
# Accept typical constructor-like values: functions or types.
85-
if !(wrapper isa Function || wrapper isa Type)
86-
throw(
87-
ArgumentError(
88-
"Each context wrapper must be a callable object or type " *
89-
"(e.g., a wrapper constructor like `Constant` or `Cache`), " *
90-
"but element $i has type $(typeof(wrapper)).",
91-
),
92-
)
93-
end
94-
end
9583
return new{C, F, B, typeof(context_wrappers)}(
9684
f,
9785
backend,

DifferentiationInterface/test/Back/DifferentiateWith/test.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ end;
127127
([2.0],),
128128
)
129129
end
130+
131+
@test_throws MethodError DifferentiateWith(exp, AutoForwardDiff(), (3,))

0 commit comments

Comments
 (0)