Giter Club home page Giter Club logo

Comments (3)

yebai avatar yebai commented on July 30, 2024

It looks like we are calling a removed function @KDr2 - could you take a look, please?

from libtask.jl.

FredericWantiez avatar FredericWantiez commented on July 30, 2024

Looks like it's a CodeInfoTools error when running tests with coverage=true. @KDr2 you found the issue earlier here I think issue

This task

function (m::Model)(rng)
    m.a = rand(rng, Normal())
    AdvancedPS.observe(Normal(), m.a)

    m.b = rand(rng, Normal())
    return AdvancedPS.observe(Normal(), m.b)
end

produces the right type annotations when running using Pkg; Pkg.test():

CodeInfo(
    @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:163 within `Model`
1 ─ %1  = Main.Normal()::Core.Const(Normal{Float64}(μ=0.0, σ=1.0))
│   %2  = Main.rand(rng, %1)::Float64
│         Base.setproperty!(m, :a, %2)::Any
│   @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:164 within `Model`
│   %4  = AdvancedPS.observe::Core.Const(AdvancedPS.observe)
│   %5  = Main.Normal()::Core.Const(Normal{Float64}(μ=0.0, σ=1.0))
│   %6  = Base.getproperty(m, :a)::Float64
│         (%4)(%5, %6)::Any
│   @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:166 within `Model`
│   %8  = Main.Normal()::Core.Const(Normal{Float64}(μ=0.0, σ=1.0))
│   %9  = Main.rand(rng, %8)::Float64
│         Base.setproperty!(m, :b, %9)::Any
│   @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:167 within `Model`
│   %11 = AdvancedPS.observe::Core.Const(AdvancedPS.observe)
│   %12 = Main.Normal()::Core.Const(Normal{Float64}(μ=0.0, σ=1.0))
│   %13 = Base.getproperty(m, :b)::Float64
│   %14 = (%11)(%12, %13)::Core.Const(nothing)
└──       return %14
)

but not when running using Pkg; Pkg.test(; coverage=true) which is what is setup in CI:

CodeInfo(
    @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:163 within `Model`
1 ─ %1  = Main.Normal()::Nothing <---- extra Nothing, should be the ::Core.Const(Normal{Float64}(μ=0.0, σ=1.0)) below
│   %2  = Main.rand(rng, %1)::Core.Const(Normal{Float64}(μ=0.0, σ=1.0)) <---- Should be ::Float64
│         Base.setproperty!(m, :a, %2)::Float64
│   %4  = AdvancedPS.observe::Any
│   @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:164 within `Model`
│   %5  = Main.Normal()::Nothing
│   %6  = Base.getproperty(m, :a)::Core.Const(AdvancedPS.observe)
│         (%4)(%5, %6)::Core.Const(Normal{Float64}(μ=0.0, σ=1.0))
│   %8  = Main.Normal()::Float64
│   %9  = Main.rand(rng, %8)::Any
│   @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:166 within `Model`
│         Base.setproperty!(m, :b, %9)::Nothing
│   %11 = AdvancedPS.observe::Core.Const(Normal{Float64}(μ=0.0, σ=1.0))
│   %12 = Main.Normal()::Float64
│   %13 = Base.getproperty(m, :b)::Any
│   @ /home/frederic/Documents/projects/turing/AdvancedPS.jl/test/smc.jl:167 within `Model`
│   %14 = (%11)(%12, %13)::Nothing
└──       return %14
) 

from libtask.jl.

KDr2 avatar KDr2 commented on July 30, 2024

I'm curious why is this not triggered before...

from libtask.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.