Skip to content

Introduce a convenience function, AutoType, to hide TypeWrap.  #610

@yebai

Description

@yebai

We introduced the TypeWrap trick in #597 for type stability. I find the name difficult to parse since TypeWrap does not hint at its purpose. Given that this trick is for automatically determining the suitable type during autodiff, we might want to introduce a convenience function, AutoType, so users can call models with:

demo(AutoType(Vector{Float64}))

instead of

demo(TypeWrap{Vector{Float64}}())

Related: TuringLang/Turing.jl#2225 (comment)

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