ReactiveBayes / BayesBase.jl

BayesBase is a package that serves as an umbrella, defining, exporting, and re-exporting methods essential for Bayesian statistics
MIT License
1 stars 1 forks source link

StackOverFlow error with Tensor distributed PointMass #18

Closed Nimrais closed 1 month ago

Nimrais commented 2 months ago

StackOverFlow error with Tensor distributed PointMass

julia> using BayesBase

julia> PointMass(ones(Int, 3, 3, 3))
PointMass{Array{Int64, 3}}([1 1 1; 1 1 1; 1 1 1;;; 1 1 1; 1 1 1; 1 1 1;;; 1 1 1; 1 1 1; 1 1 1])

julia> pm = PointMass(ones(Int, 3, 3, 3))
PointMass{Array{Int64, 3}}([1 1 1; 1 1 1; 1 1 1;;; 1 1 1; 1 1 1; 1 1 1;;; 1 1 1; 1 1 1; 1 1 1])

julia> mean(pm)
ERROR: StackOverflowError:
Stacktrace:
 [1] mean(itr::PointMass{Array{Int64, 3}})
   @ Statistics ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Statistics/src/Statistics.jl:44
 [2] mean(fn::typeof(identity), distribution::PointMass{Array{Int64, 3}})
   @ BayesBase ~/repos/ReactiveBayes/BayesBase.jl/src/densities/pointmass.jl:26