Skip to content

Commit

Permalink
Add squeeze to adapter (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
elseml authored Dec 20, 2024
1 parent 5038806 commit d367cfd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bayesflow/adapters/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ def as_time_series(self, keys: str | Sequence[str]):
return self

def broadcast(
self, keys: str | Sequence[str], *, to: str, expand: str | int | tuple = "left", exclude: int | tuple = -1
self,
keys: str | Sequence[str],
*,
to: str,
expand: str | int | tuple = "left",
exclude: int | tuple = -1,
squeeze: int | tuple = None,
):
if isinstance(keys, str):
keys = [keys]

transform = Broadcast(keys, to=to, expand=expand, exclude=exclude)
transform = Broadcast(keys, to=to, expand=expand, exclude=exclude, squeeze=squeeze)
self.transforms.append(transform)
return self

Expand Down

0 comments on commit d367cfd

Please sign in to comment.