-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GradientNumber Promotion Error on Julia v0.5 #88
Comments
'f' need to return a scalar, no? |
We should probably have a better error message for this, since it seems to be a common mistake. |
Sorry about this @jrevels, @KristofferC , you are right, I should had used the I will try to come up with a better example related to what I am trying to do and what error message I get. |
Ok, attempt 2 to construct a relevant example. This is similar to what I am trying to do:
This is the error I get:
|
Hmm. Looks like v0.5-specific breakage. It seems to work on v0.4: julia> import ForwardDiff
julia> f(x::Vector) = sum(1+exp(x))
f (generic function with 1 method)
julia> g = ForwardDiff.gradient(f)
g (generic function with 1 method)
julia> g([3.5, 4.1])
2-element Array{Float64,1}:
33.1155
60.3403 |
Ah, yes, it works on v0.4, didn't notice :) |
I don't think the problem is with the promotion but in type inference, maybe same as #75. |
This now works, either due to advances in Julia v0.5 or #102. |
The following example fails:
The error I get is the following:
The text was updated successfully, but these errors were encountered: