From 7500a8410995f65f5675c07f73c7342b2e2e6535 Mon Sep 17 00:00:00 2001 From: arrjon Date: Mon, 14 Apr 2025 15:09:01 +0200 Subject: [PATCH 1/2] fix dict utils --- bayesflow/utils/dict_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bayesflow/utils/dict_utils.py b/bayesflow/utils/dict_utils.py index 7e9fb67f0..ede035cf2 100644 --- a/bayesflow/utils/dict_utils.py +++ b/bayesflow/utils/dict_utils.py @@ -222,7 +222,7 @@ def make_variable_array( else: raise TypeError(f"Only dicts and tensors are supported as arguments, but your estimates are of type {type(x)}") - if len(variable_names) is not x.shape[-1]: + if len(variable_names) == x.shape[-1]: raise ValueError("Length of 'variable_names' should be the same as the number of variables.") if variable_keys is None: From eed2fe2b044aabc9a1d7451919cda1b96fcadc9c Mon Sep 17 00:00:00 2001 From: arrjon Date: Mon, 14 Apr 2025 15:20:10 +0200 Subject: [PATCH 2/2] fix dict utils --- bayesflow/utils/dict_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bayesflow/utils/dict_utils.py b/bayesflow/utils/dict_utils.py index ede035cf2..6a4cf4a3d 100644 --- a/bayesflow/utils/dict_utils.py +++ b/bayesflow/utils/dict_utils.py @@ -222,7 +222,7 @@ def make_variable_array( else: raise TypeError(f"Only dicts and tensors are supported as arguments, but your estimates are of type {type(x)}") - if len(variable_names) == x.shape[-1]: + if len(variable_names) != x.shape[-1]: raise ValueError("Length of 'variable_names' should be the same as the number of variables.") if variable_keys is None: