-
Notifications
You must be signed in to change notification settings - Fork 431
Open
Description
I doubt anybody is actually doing this, but arguably for consistency's sake, this shouldn't error:
julia> n = reshape(Normal(), ())
Distributions.ReshapedDistribution{0, Continuous, Normal{Float64}}(
dist: Normal{Float64}(μ=0.0, σ=1.0)
dims: ()
)
julia> rand(n)
ERROR: MethodError: no method matching iterate(::Distributions.ReshapedDistribution{0, Continuous, Normal{Float64}})
The function `iterate` exists, but no method is defined for this combination of argument types.
Closest candidates are:
iterate(::LibGit2.GitRebase)
@ LibGit2 ~/.julia/juliaup/julia-1.11.8+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LibGit2/src/rebase.jl:48
iterate(::LibGit2.GitRebase, ::Any)
@ LibGit2 ~/.julia/juliaup/julia-1.11.8+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LibGit2/src/rebase.jl:48
iterate(::Revise.SigInfo)
@ Revise ~/.julia/packages/Revise/KjLt4/src/types.jl:67
...
Stacktrace:
[1] copyto!(dest::Vector{Float64}, src::Distributions.ReshapedDistribution{0, Continuous, Normal{Float64}})
@ Base ./abstractarray.jl:934
[2] _collect(cont::UnitRange{…}, itr::Distributions.ReshapedDistribution{…}, ::Base.HasEltype, isz::Base.HasLength)
@ Base ./array.jl:722
[3] collect(itr::Distributions.ReshapedDistribution{0, Continuous, Normal{Float64}})
@ Base ./array.jl:716
[4] quantile(itr::Distributions.ReshapedDistribution{…}, p::Float64; sorted::Bool, alpha::Float64, beta::Float64)
@ Statistics ~/.julia/packages/Statistics/gbcbG/src/Statistics.jl:1090
[5] rand(rng::Random.TaskLocalRNG, d::Distributions.ReshapedDistribution{0, Continuous, Normal{Float64}})
@ Distributions ~/.julia/packages/Distributions/xMnxM/src/univariates.jl:157
[6] rand(::Distributions.ReshapedDistribution{0, Continuous, Normal{Float64}})
@ Distributions ~/.julia/packages/Distributions/xMnxM/src/genericrand.jl:22
[7] top-level scope
@ REPL[21]:1
Some type information was truncated. Use `show(err)` to see complete types.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels