Skip to content

Commit f57af0c

Browse files
committed
Convert condition tensors to arrays before passing to adapter
1 parent 72180e3 commit f57af0c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bayesflow/approximators/continuous_approximator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ def sample(
470470
samples = split_arrays(samples, axis=-1)
471471

472472
if keep_conditions:
473+
conditions = keras.tree.map_structure(keras.ops.convert_to_numpy, conditions)
473474
conditions = self.adapter(conditions, inverse=True, strict=False, **kwargs)
474475
repeated_conditions = keras.tree.map_structure(
475476
lambda tensor: np.repeat(np.expand_dims(tensor, axis=1), num_samples, axis=1), conditions

0 commit comments

Comments
 (0)