Skip to content

Commit 955ac79

Browse files
committed
Make use of approximator.build_from_data() in fit
1 parent 711cd7b commit 955ac79

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bayesflow/approximators/approximator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ def fit(self, *, dataset: keras.utils.PyDataset = None, simulator: Simulator = N
133133
logging.info("Building on a test batch.")
134134
mock_data = dataset[0]
135135
mock_data = keras.tree.map_structure(keras.ops.convert_to_tensor, mock_data)
136-
mock_data_shapes = keras.tree.map_structure(keras.ops.shape, mock_data)
137-
self.build(mock_data_shapes)
136+
self.build_from_data(mock_data)
138137

139138
return super().fit(dataset=dataset, **kwargs)

0 commit comments

Comments
 (0)