-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Some gradient errors #66
Comments
On Julia master I get julia> function ff(x, t = [1,2,3])
a = dropdims(sum( x .^ t' , dims=1), dims=1)
sum(x)
end
ff (generic function with 2 methods)
julia> ff(ones(3))
3.0
julia> gradient(ff, ones(3))
(Int8[1, 1, 1],)
julia> function hh(x)
a = sum( x .^ [1 2 3] , dims=1)
sum(x)
end
hh (generic function with 1 method)
julia> gradient(hh, ones(3))
ERROR: Mutating arrays is not supported Closing this as fixed since the compiler errors are gone; of course the second example should work ideally, but that's just a case of #81. |
Thanks, sounds good. I have one more case which boils down to the following: julia> using Zygote
julia> y, back = Zygote._forward((m,v) -> (v .+ v' .+ m)[1,1], rand(3,3), rand(3))
(1.7873601043525784, ∂(getfield(Main, Symbol("##43#44"))()))
julia> back(0.666)
ERROR: BoundsError: attempt to access 0-element Array{Core.Compiler.BasicBlock,1} at index [1]
Stacktrace:
[1] getindex at ./array.jl:729 [inlined]
[2] iterate(::Core.Compiler.IncrementalCompact, ::Tuple{Int64,Int64}) at ./compiler/ssair/ir.jl:1077
[3] iterate at ./compiler/ssair/ir.jl:1070 [inlined] |
Yup, you found another compiler bug there. Will reopen in that case. (You are also free to open new issues for new errors though). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a go at using Zygote on something, and got some errors, which survive in the following simplified examples:
and
I also got the same error as #47, but only when using a custom type; could try to boil that down if it would be helpful.
All on master of today, and Julia 1.1.
The text was updated successfully, but these errors were encountered: