Skip to content

Commit 88c72ee

Browse files
committed
do not fail if no transform is used
1 parent fada322 commit 88c72ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bayesflow/approximators/continuous_approximator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ def log_prob(self, data: Mapping[str, np.ndarray], **kwargs) -> np.ndarray | dic
392392
log_prob = self._log_prob(**data, **kwargs)
393393
log_prob = keras.tree.map_structure(keras.ops.convert_to_numpy, log_prob)
394394

395-
return log_prob + jacobian["inference_variables"]
395+
jacobian = jacobian.get("inference_variables")
396+
if jacobian is not None:
397+
log_prob = log_prob + jacobian
398+
399+
return log_prob
396400

397401
def _log_prob(
398402
self,

0 commit comments

Comments
 (0)