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

StackOverflow on calling inverse VecCorrBijector with a multidimensional array #320

Closed
mhauru opened this issue Jun 28, 2024 · 1 comment · Fixed by #355
Closed

StackOverflow on calling inverse VecCorrBijector with a multidimensional array #320

mhauru opened this issue Jun 28, 2024 · 1 comment · Fixed by #355

Comments

@mhauru
Copy link
Member

mhauru commented Jun 28, 2024

using Bijectors: VecCorrBijector, inverse
inverse(VecCorrBijector())([[1.0]])

causes a stack overflow. It may be a non-sense call, but it should error in a more helpful, manageable way.

@penelopeysm
Copy link
Member

penelopeysm commented Nov 30, 2024

function with_logabsdet_jacobian(::Inverse{VecCorrBijector}, y::AbstractVector{<:Real})

Broadening the type on y here would avoid the infinite recursion:

- function with_logabsdet_jacobian(::Inverse{VecCorrBijector}, y::AbstractVector{<:Real})
+ function with_logabsdet_jacobian(::Inverse{VecCorrBijector}, y)
julia> inverse(VecCorrBijector())([[1.0]])
ERROR: MethodError: no method matching AbstractFloat(::Type{Vector{Float64}})
The type `AbstractFloat` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  AbstractFloat(::Bool)
   @ Base float.jl:344
  AbstractFloat(::Int8)
   @ Base float.jl:345
  AbstractFloat(::UInt32)
   @ Base float.jl:352
  ...

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

Successfully merging a pull request may close this issue.

2 participants