Skip to content

Commit 1081bbd

Browse files
committed
FlowMatching: build self instead of base_distribution
1 parent fdac500 commit 1081bbd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bayesflow/networks/flow_matching/flow_matching.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,10 @@ def compute_metrics(
191191
else:
192192
# not pre-configured, resample
193193
x1 = x
194-
if not self.base_distribution.built:
195-
# ensure that base distribution is built
196-
self.base_distribution.build(keras.ops.shape(x1))
194+
if not self.built:
195+
xz_shape = keras.ops.shape(x1)
196+
conditions_shape = None if conditions is None else keras.ops.shape(conditions)
197+
self.build(xz_shape, conditions_shape)
197198
x0 = self.base_distribution.sample(keras.ops.shape(x1)[:-1])
198199

199200
if self.use_optimal_transport:

0 commit comments

Comments
 (0)