-
Notifications
You must be signed in to change notification settings - Fork 57
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
MethodError from using sum(x, 2)
#34
Comments
You're attempting to do ReverseDiff.@forward(f)(args::Real...)
ReverseDiff.@forward f(args::Real...) = ...
ReverseDiff.@forward f = (args::Real...) -> ... If you remove There could be a better error message here, and also we should support this in the future. |
Should have mentioned this but even without
Looks like the same error. |
That looks like what I fixed in #33 - have you updated to the latest release ( julia> using ReverseDiff
julia> begin
p = randn(2,3)
f(p) = exp.(p) ./ sum(exp.(p), 2) # softmax
f! = ReverseDiff.compile_gradient(x -> sum(f(x)), similar(p))
f!(similar(p), p)
end
2×3 Array{Float64,2}:
2.77556e-17 5.55112e-17 5.55112e-17
0.0 0.0 0.0 |
I was on master which is 2 commits ahead it seems. Went to |
Ah, that's not good. Thanks for letting me know. Looks like I should add |
Gives the following error
If I do
ReverseDiff.@forward f(p) = exp.(p) ./ sum(exp.(p))
there's no error. So, I'm guessing it's something to do with adding the dimension to sum over.The text was updated successfully, but these errors were encountered: