-
Notifications
You must be signed in to change notification settings - Fork 219
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
Relaxing ::Real
requirement?
#2133
Comments
Do you mean allow distributions on the RHS of |
It all depends on what you mean by "real" here... For example: using Unitful
x = 0.5u"km/h" this is a real-valued number. However, in Julia it's actually |
So I meant |
I see, thanks. Okay I'm currently working on this in DynamicQuantities.jl (alternative to Unitful) – SymbolicML/DynamicQuantities.jl#85. Once that is done hopefully you could use |
Too bad, it seems like a lot of things in Distributions.jl are hard-coded to Float64 (or assumptions related to floats), so this is probably impossible. Thanks anyways. |
Technically it's possible to support non-Distributions.jl types, but it will take time to get there and we haven't seen sufficient amount of motivation to motivation for us to prioritize it, I think 😕 But you can do stuff like: @model function demo()
x_without_unit ~ Normal()
x = # make it unitful ...
end of course. |
Hi everyone,
Awesome package and ecosystem. I'm really enjoying it!
I was wondering if the requirement for numeric types to be
::Real
could be relaxed to::Any
? Since Julia doesn't have multiple inheritance, this limits the range of types you can use perhaps more than necessary. There are some types which act exactly like aReal
in every other way, except they do not inherit fromReal
, so it would be great if one could use those as well.My specific use-case is I'm trying to use physical units in a TuringLang model, but both
Unitful.Quantity
andDynamicQuantities.Quantity
are<:Number
so are incompatible, despite the numerical type being aReal
in both cases (base typeFloat64
).Cheers,
Miles
The text was updated successfully, but these errors were encountered: