Skip to content
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

logabsgamma doesn't work with ForwardDiff #49

Closed
Moelf opened this issue May 4, 2022 · 2 comments
Closed

logabsgamma doesn't work with ForwardDiff #49

Moelf opened this issue May 4, 2022 · 2 comments

Comments

@Moelf
Copy link

Moelf commented May 4, 2022

ERROR: MethodError: no method matching _logabsgamma(::ForwardDiff.Dual{ForwardDiff.Tag{Optim.var"#135#136"{LiteHF.var"#54#55"{LiteHF.var"#52#53"{Tuple{LiteHF.FlatPrior{Int64}, Distributions.Normal{Float64}, Distributions.Normal{Float64}, LiteHF.RelaxedPoisson{Float64}, LiteHF.RelaxedPoisson{Float64}}}, LiteHF.var"#45#48"{LiteHF.var"#27#35"{Tuple{LiteHF.var"#40#44"{Tuple{Vector{Int64}, Vector{Int64}, Vector{Int64}}, Tuple{ExpCounts{}
, ExpCounts{}
, ExpCounts{}
}}}}, Tuple{JSON3.Array{Int64, Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}}, LiteHF.var"#f#47"}}}, Float64}, Float64, 5})
Closest candidates are:
  _logabsgamma(::Float64) at ~/.julia/packages/SpecialFunctions/CQMHW/src/gamma.jl:601
  _logabsgamma(::Float32) at ~/.julia/packages/SpecialFunctions/CQMHW/src/gamma.jl:606
  _logabsgamma(::Float16) at ~/.julia/packages/SpecialFunctions/CQMHW/src/gamma.jl:611
  ...
Stacktrace:
  [1] logabsgamma(x::ForwardDiff.Dual{ForwardDiff.Tag{Optim.var"#135#136"{LiteHF.var"#54#55"{LiteHF.var"#52#53"{Tuple{LiteHF.FlatPrior{Int64}, Distributions.Normal{Float64}, Distributions.Normal{Float64}, LiteHF.RelaxedPoisson{Float64}, LiteHF.RelaxedPoisson{Float64}}}, LiteHF.var"#45#48"{LiteHF.var"#27#35"{Tuple{LiteHF.var"#40#44"{Tuple{Vector{Int64}, Vector{Int64}, Vector{Int64}}, Tuple{ExpCounts{}
, ExpCounts{}
, ExpCounts{}
}}}}, Tuple{JSON3.Array{Int64, Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}}, LiteHF.var"#f#47"}}}, Float64}, Float64, 5})
    @ SpecialFunctions ~/.julia/packages/SpecialFunctions/CQMHW/src/gamma.jl:599

should this be raised in SpecialFunctions instead?

@Moelf
Copy link
Author

Moelf commented May 4, 2022

@devmotion
Copy link
Member

As @andreasnoack wrote this seems to be a DiffRules issue that could be solved by adding a rule for logabsgamma there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants