Closed mhauru closed 3 months ago
Fixed by JLL bump
MWE that used to provoke this:
module MWE
using FiniteDifferences
using Enzyme
#Enzyme.API.runtimeActivity!(true)
struct G{T}
this_field_does_nothing::T
b::T
end
G() = G{Float64}(0.0, 1.0)
function f(vec)
x = vec[1]
empty = []
d = G(empty...)
return x ≤ d.b ? x * d.b : zero(x)
end
vec = [0.5]
finitediff = FiniteDifferences.grad(central_fdm(5, 1), f, vec)[1]
reverse_grad = Enzyme.gradient(Enzyme.Reverse, f, vec)
forward_grad = Enzyme.gradient(Enzyme.Forward, f, vec)
@show finitediff
@show reverse_grad
@show forward_grad
end
As discussed with @wsmoses.