I am trying to create a new (Float64) vector based on an input.
Here is a simplified example:
julia> function f(x)
L1 = 1.0
L2 = 100.0
n1 = x
while n1 > L1
n1 /= 2.0
end
n2 = x
while n2 < L2
n2 *= 2.0
end
n1 = floor(n1)
n2 = ceil(n2)
S = [n1:1.0:n2;]
# S = collect(n1:1.0:n2)
return sum(S)
end
f (generic function with 1 method)
julia> f(10.0)
12880.0
It failed when I tried to to calculate the autodiff based on Enzyme.jl (version 0.10.1, Julia 1.7.1):
using Enzyme
Enzyme.autodiff( Reverse, f, Active, Active(10.0) )
I am trying to create a new (Float64) vector based on an input. Here is a simplified example:
It failed when I tried to to calculate the autodiff based on Enzyme.jl (version 0.10.1, Julia 1.7.1):
Here is the log:
How can it be fixed?