Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yebai opened this issue May 17, 2024 · 0 comments
Open

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

yebai opened this issue May 17, 2024 · 0 comments

Comments

@yebai
Copy link
Member

yebai commented May 17, 2024

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)

@yebai yebai changed the title Rename TypeWrap to AutoType Introduce a convenience function, AutoType, to hide TypeWrap. May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant