@@ -866,48 +866,9 @@ Returns a tuple of the model's return value, plus the updated `varinfo`
866
866
(unwrapped if necessary).
867
867
"""
868
868
function AbstractPPL. evaluate!! (model:: Model , varinfo:: AbstractVarInfo )
869
- return if use_threadsafe_eval (model. context, varinfo)
870
- evaluate_threadsafe!! (model, varinfo)
871
- else
872
- evaluate_threadunsafe!! (model, varinfo)
873
- end
874
- end
875
-
876
- """
877
- evaluate_threadunsafe!!(model, varinfo)
878
-
879
- Evaluate the `model` without wrapping `varinfo` inside a `ThreadSafeVarInfo`.
880
-
881
- If the `model` makes use of Julia's multithreading this will lead to undefined behaviour.
882
- This method is not exposed and supposed to be used only internally in DynamicPPL.
883
-
884
- See also: [`evaluate_threadsafe!!`](@ref)
885
- """
886
- function evaluate_threadunsafe!! (model, varinfo)
887
869
return _evaluate!! (model, resetaccs!! (varinfo))
888
870
end
889
871
890
- """
891
- evaluate_threadsafe!!(model, varinfo, context)
892
-
893
- Evaluate the `model` with `varinfo` wrapped inside a `ThreadSafeVarInfo`.
894
-
895
- With the wrapper, Julia's multithreading can be used for observe statements in the `model`
896
- but parallel sampling will lead to undefined behaviour.
897
- This method is not exposed and supposed to be used only internally in DynamicPPL.
898
-
899
- See also: [`evaluate_threadunsafe!!`](@ref)
900
- """
901
- function evaluate_threadsafe!! (model, varinfo)
902
- wrapper = ThreadSafeVarInfo (resetaccs!! (varinfo))
903
- result, wrapper_new = _evaluate!! (model, wrapper)
904
- # TODO (penelopeysm): If seems that if you pass a TSVI to this method, it
905
- # will return the underlying VI, which is a bit counterintuitive (because
906
- # calling TSVI(::TSVI) returns the original TSVI, instead of wrapping it
907
- # again).
908
- return result, setaccs!! (wrapper_new. varinfo, getaccs (wrapper_new))
909
- end
910
-
911
872
"""
912
873
_evaluate!!(model::Model, varinfo)
913
874
0 commit comments