From 7499bfd1a5bb4276ad84390598092c5d1fef8e51 Mon Sep 17 00:00:00 2001 From: Junpeng Lao Date: Thu, 14 Dec 2023 12:20:33 +0100 Subject: [PATCH] Extend Error handling in run_inference_algorithm Minor change. --- blackjax/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blackjax/util.py b/blackjax/util.py index ee226a5ac..df527ed01 100644 --- a/blackjax/util.py +++ b/blackjax/util.py @@ -182,7 +182,7 @@ def run_inference_algorithm( init_key, sample_key = split(rng_key, 2) try: initial_state = inference_algorithm.init(initial_state_or_position, init_key) - except TypeError: + except (TypeError, ValueError, AttributeError): # We assume initial_state is already in the right format. initial_state = initial_state_or_position