Skip to content

Commit f1c0c87

Browse files
authored
Merge pull request #530 from bayesflow-org/529-bug-serialization-of-the-broadcast-transformation
Fix of broadcast serialization bug
2 parents 47bf8e8 + 36b38f0 commit f1c0c87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bayesflow/adapters/transforms/broadcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def forward(self, data: dict[str, np.ndarray], **kwargs) -> dict[str, np.ndarray
117117
data[k] = np.expand_dims(data[k], axis=tuple(np.arange(0, len_diff)))
118118
elif self.expand == "right":
119119
data[k] = np.expand_dims(data[k], axis=tuple(-np.arange(1, len_diff + 1)))
120-
elif isinstance(self.expand, tuple):
120+
elif isinstance(self.expand, Sequence):
121121
if len(self.expand) is not len_diff:
122122
raise ValueError("Length of `expand` must match the length difference of the involed arrays.")
123123
data[k] = np.expand_dims(data[k], axis=self.expand)

0 commit comments

Comments
 (0)