Skip to content

Commit f1e1ba1

Browse files
committed
Fix dtype of dummy conditions if inference variables are available
1 parent 1405ee5 commit f1e1ba1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bayesflow/networks/point_inference_network.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ def call(
132132
if xz is None and not self.built:
133133
raise ValueError("Cannot build inference network without inference variables.")
134134
if conditions is None: # unconditional estimation uses a fixed input vector
135-
conditions = keras.ops.convert_to_tensor([[1.0]])
135+
conditions = keras.ops.convert_to_tensor(
136+
[[1.0]], dtype=keras.ops.dtype(xz) if xz is not None else "float32"
137+
)
136138

137139
# pass conditions to the shared subnet
138140
output = self.subnet(conditions, training=training)

0 commit comments

Comments
 (0)