Use OnlyAccsVarInfo in check_model #2742
Merged
+8
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because the model is contextualised with InitContext, the call to check_model doesn't actually need anything more than an OnlyAccsVarInfo. This allows models that don't work well with Metadata* to still be checked for validity (note that the check, as defined in DynamicPPL, only uses DebugAccumulator, it does not actually use metadata in any form -- unless the model has DefaultContext as its leaf context -- which is not the case here).
(cc @PTWaade I think this is the reason why check_model failed)
* one might ask what models don't work well with metadata, but still otherwise work. There are a couple of things that come to mind: 1) parallel assume statements; and 2) special distribution types for which the from_[linked_]_vec_transform functions are not defined. These models should in principle work with
Prior()sampling, which only ever uses OnlyAccsVarInfo. However, currently, they don't unless you disable check_model; this is the behaviour that this PR fixes.