You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am training to construct a Categorical Distribution with an ArrayPartition vector it fails with a conversion error.
using RecursiveArrayTools
using Distributions
Categorical(ArrayPartition([1/3, 1/3], [1/3]))
Error
ERROR: MethodError: Cannot `convert` an object of type Vector{Float64} to an object of type ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}
Closest candidates are:convert(::Type{ArrayPartition{T, S}}, ::ArrayPartition{<:Any, <:Tuple{Vararg{Any, N}}}) where {N, T, S<:Tuple{Vararg{Any, N}}}
@ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/K1bCr/src/array_partition.jl:543convert(::Type{T}, ::T) where T
@ Base Base.jl:84convert(::Type{T}, ::T) where T<:AbstractArray
@ Base abstractarray.jl:16...
Stacktrace:
[1] Categorical{Float64, ArrayPartition{…}}(xs::Base.OneTo{Int64}, ps::ArrayPartition{Float64, Tuple{…}}; check_args::Bool)
@ Distributions ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/discretenonparametric.jl:34
[2] DiscreteNonParametric
@ ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/discretenonparametric.jl:24 [inlined]
[3] #_#115
@ ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/categorical.jl:31 [inlined]
[4] DiscreteNonParametric
@ ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/categorical.jl:29 [inlined]
[5] (Categorical{P} where P<:Real)(p::ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}})
@ Distributions ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/categorical.jl:34
[6] top-level scope
@ ~/repos/ReactiveBayes/ExponentialFamily.jl/categorical_bug.jl:4
Some type information was truncated. Use `show(err)` to see complete types.
ERROR: MethodError: Cannot `convert` an object of type Vector{Float64} to an object of type ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}
Closest candidates are:convert(::Type{ArrayPartition{T, S}}, ::ArrayPartition{<:Any, <:Tuple{Vararg{Any, N}}}) where {N, T, S<:Tuple{Vararg{Any, N}}}
@ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/K1bCr/src/array_partition.jl:543convert(::Type{T}, ::T) where T
@ Base Base.jl:84convert(::Type{T}, ::T) where T<:AbstractArray
@ Base abstractarray.jl:16...
Stacktrace:
[1] Categorical{Float64, ArrayPartition{…}}(xs::Base.OneTo{Int64}, ps::ArrayPartition{Float64, Tuple{…}}; check_args::Bool)
@ Distributions ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/discretenonparametric.jl:34
[2] DiscreteNonParametric
@ ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/discretenonparametric.jl:24 [inlined]
[3] #_#115
@ ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/categorical.jl:31 [inlined]
[4] DiscreteNonParametric
@ ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/categorical.jl:29 [inlined]
[5] (Categorical{P} where P<:Real)(p::ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}})
@ Distributions ~/.julia/packages/Distributions/ji8PW/src/univariate/discrete/categorical.jl:34
[6] top-level scope
@ ~/repos/ReactiveBayes/ExponentialFamily.jl/categorical_bug.jl:4
Some type information was truncated. Use `show(err)` to see complete types.
Hi! Thanks for this great package.
When I am training to construct a Categorical Distribution with an ArrayPartition vector it fails with a conversion error.
Error
Distributions v0.25.109
RecursiveArrayTools v3.26.0
The text was updated successfully, but these errors were encountered: