denizyuret / AutoGrad.jl

Julia port of the Python autograd package.
Other
169 stars 26 forks source link

Fix #87 #91

Closed ekinakyurek closed 6 years ago

denizyuret commented 6 years ago

Can you explain this PR? Do you now why the tests are failing?

rened commented 6 years ago

Note that even without any dimsargument, this PR and master are type unstable for mean, while on Julia 0.6 it correctly returns an Array{Float32,2}:

julia> x = rand(Float32,2,3);

julia> grad(x->x[1])(x)
2×3 Array{Float32,2}:
 1.0  0.0  0.0
 0.0  0.0  0.0

julia> grad(x->mean(x))(x)
2×3 Array{Float64,2}:
 0.166667  0.166667  0.166667
 0.166667  0.166667  0.166667