Skip to content

Add promote rule for the type of raw probabilities #37

@ablaom

Description

@ablaom
using CategoricalDistributions
d1 = UnivariateFinite([0.2, 0.3])
d2 = UnivariateFinite([Float32(0.2), Float32(0.3)]);
v = [d1, d2];
julia> typeof.(v)
2-element Vector{DataType}:
 UnivariateFinite{Multiclass{2}, String, UInt8, Float64}
 UnivariateFinite{Multiclass{2}, String, UInt8, Float32}
julia> eltype(v)
UnivariateFinite{Multiclass{2}, String, UInt8}

What the last line in the code snippet above "should" be is UnivariateFinite{Multiclass{2}, String, UInt8, Float64}, which a promote_rule "lifting" promotion in P will do, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions