That’s what the linked tutorial shows how to do:
if tmp_sol.retcode == :Success
# do normal thing
else
# handle bad case
end
Look at the SDE case from the Turing tutorial:
# Early exit if simulation could not be computed successfully.
if predicted.retcode !== :Success
Turing.@addlogprob! -Inf
return nothing
end
That’s how you make it throw away a sample.