Comments (9)
Some warntype stuff shows it as well:
Good with *
:
julia> @code_warntype *(Array(ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}}),1.0)
Variables:
A::Array{ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},0}
B::Float64
Body:
begin # abstractarraymath.jl, line 55:
return A::Array{ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},0} .* B::Float64::Array{ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},0}
end::Array{ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},0}
Bad with /
:
julia> @code_warntype /(Array(ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}}),1.0)
Variables:
A::Array{ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},0}
B::Float64
Body:
begin # abstractarraymath.jl, line 57:
return A::Array{ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},0} ./ B::Float64::Array{ForwardDiff.GradientNumber{N,T,C},0}
end::Array{ForwardDiff.GradientNumber{N,T,C},0}
from forwarddiff.jl.
Doing @code_warntype
on ./
shows the following instability in one of the lines:
GenSym(4) = x::ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}} ./ y::Float64::ForwardDiff.GradientNumber{N,T,C}
from forwarddiff.jl.
Seems to be a regression in type inference?
Same code: http://imgur.com/vcUHMHC
from forwarddiff.jl.
Tracked at JuliaLang/julia#14294
from forwarddiff.jl.
Very nice detective work, thanks!
from forwarddiff.jl.
Confirmed fixed on master
julia> Base.return_types(*, (ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},Float64))
1-element Array{Any,1}:
ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}}
from forwarddiff.jl.
There was no regression test added upstream, could we put one here?
from forwarddiff.jl.
I don't have a small repo right now.
from forwarddiff.jl.
It seems there was a regression on Julia master for this, could someone else verify?
julia> Base.return_types(*, (ForwardDiff.GradientNumber{2,Float64,Tuple{Float64,Float64}},Float64))
1-element Array{Any,1}:
ForwardDiff.GradientNumber{N,T,C}
julia> versioninfo()
Julia Version 0.5.0-dev+3977
Commit 957f1d1 (2016-05-08 00:28 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin15.4.0)
CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
from forwarddiff.jl.
Related Issues (20)
- Can you take derivative of complicated function whose symbolic form is not explicit or not known?
- Cancellation with sparse arrays HOT 5
- Implement hessian! for scalar x
- Implement gammalogccdf for ForwardDiff HOT 1
- `ForwardDiff.jacobian` throws error for `fft` HOT 1
- Correctly forming nested dual numbers. HOT 8
- Derivative of a function of derivatives HOT 7
- Symbolics.jl compatibility HOT 1
- Support derivative(f, ::Complex)
- `ForwardDiff` fails to compute correct derivative HOT 3
- Incorrect Hessian by `exp` function HOT 1
- Method ambiguities reported by Aqua HOT 3
- Document internals? HOT 1
- Bug (NaNs) when differentiating eigenvectors of Symmetric matrices
- Error requiring `Symbolics` from `Optimization` HOT 1
- promote_rule ambiguity with AbstractIrrational and ForwardDiff.Dual HOT 2
- Allocation tests broken since Julia 1.9
- LoadError: ArgumentError: Package AdaptStaticArraysCoreExt does not have Adapt in its dependencies: HOT 2
- Working with anonymous functions HOT 2
- DiffResults objects are not re-aliased properly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forwarddiff.jl.