We introduced the TypeWrap trick in https://github.com/TuringLang/DynamicPPL.jl/pull/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:
We introduced the
TypeWrap
trick in https://github.com/TuringLang/DynamicPPL.jl/pull/597 for type stability. I find the name difficult to parse sinceTypeWrap
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:instead of
Related: https://github.com/TuringLang/Turing.jl/pull/2225#issue-2302319223