-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
julia> x_seed = [1.0]
1-element Array{Float64,1}:
1.0
julia> f(x) = x
f (generic function with 1 method)
julia> gcfg = ReverseDiff.GradientConfig(x_seed)
ReverseDiff.GradientConfig
julia> g! = (x, out) -> ReverseDiff.gradient!(out, f, x, gcfg)
(::#17) (generic function with 1 method)
julia> g!([1.0], [0.0])
1-element Array{Float64,1}:
0.0
julia> f(x) = 1.0*x
f (generic function with 1 method)
julia> g!([1.0], [0.0])
1-element Array{Float64,1}:
1.0
julia> f(x) = 3.0*x
f (generic function with 1 method)
julia> g!([1.0], [0.0])
1-element Array{Float64,1}:
3.0Granted, not the most interesting function in the world, but there must be something that you're missing here, since it doesn't think the function changes with x.
Metadata
Metadata
Assignees
Labels
No labels