-
Notifications
You must be signed in to change notification settings - Fork 222
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
observe and assume #504
Comments
I think this should work. Actually, when
This in-place + non in-place signature was introduced when we moved to ReverseDiff, for which initialising a |
I don't know how straightforward it will be to move towards immutability using the current Also bear in mind that we're not getting the performance gains anymore as we're not using |
This is fixed by #706
This is still not fixed. Maybe we can address this after #750 |
Closed by #995 |
I think the following points regarding the current code might be problematic and changing them could improve our codebase.
Assume and observe dispatch on the sampler type (which is fine) but also on
Nothing
. This forces us to passnothing
to the functions if no sampler is defined and have aUnion{Nothing, Sampler}
for the model functions. I think we can circumvent this by having different function signatures, one with and one without the sampler argument. Or do I miss something here?Currently assume and observe do in-place operations and not in-place operations at the same time More precisely, they change the VarInfo variable and also return values that are used later on. This is inconsistent and might lead to strange behaviour. I would prefer to make this consistent and ensure that all operations are either in-place or not. I feel the mixed behaviour is not very clean. See for example:
Turing.jl/src/samplers/sampler.jl
Line 93 in 7cb84a5
Turing.jl/src/samplers/sampler.jl
Line 42 in 7cb84a5
Or is there a reason why cannot do all operations in-place?
cc: @yebai
The text was updated successfully, but these errors were encountered: