Giter Club home page Giter Club logo

Comments (9)

KristofferC avatar KristofferC commented on May 22, 2024

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.

KristofferC avatar KristofferC commented on May 22, 2024

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.

KristofferC avatar KristofferC commented on May 22, 2024

Seems to be a regression in type inference?
Same code: http://imgur.com/vcUHMHC

from forwarddiff.jl.

KristofferC avatar KristofferC commented on May 22, 2024

Tracked at JuliaLang/julia#14294

from forwarddiff.jl.

jrevels avatar jrevels commented on May 22, 2024

Very nice detective work, thanks!

from forwarddiff.jl.

KristofferC avatar KristofferC commented on May 22, 2024

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.

mlubin avatar mlubin commented on May 22, 2024

There was no regression test added upstream, could we put one here?

from forwarddiff.jl.

KristofferC avatar KristofferC commented on May 22, 2024

I don't have a small repo right now.

from forwarddiff.jl.

Ken-B avatar Ken-B commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.