Skip to content

Commit 087d485

Browse files
Atticus1806albertz
andauthored
Frontends: Add tensor info to assert (#43)
* add tensor info to assert --------- Co-authored-by: Albert Zeyer <[email protected]>
1 parent 933c6c1 commit 087d485

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

i6_models/parts/frontend/generic_frontend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def __init__(self, model_cfg: GenericFrontendV1Config):
195195
)
196196

197197
def forward(self, tensor: torch.Tensor, sequence_mask: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
198-
assert tensor.shape[-1] == self.cfg.in_features
198+
assert tensor.shape[-1] == self.cfg.in_features, f"shape {tensor.shape} vs in features {self.cfg.in_features}"
199199
# and add a dim
200200
tensor = tensor[:, None, :, :] # [B,C=1,T,F]
201201

i6_models/parts/frontend/vgg_act.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def forward(self, tensor: torch.Tensor, sequence_mask: torch.Tensor) -> Tuple[to
158158
:param sequence_mask: the sequence mask for the tensor
159159
:return: torch.Tensor of shape [B,T",F'] and the shape of the sequence mask
160160
"""
161-
assert tensor.shape[-1] == self.cfg.in_features
161+
assert tensor.shape[-1] == self.cfg.in_features, f"shape {tensor.shape} vs in features {self.cfg.in_features}"
162162
# and add a dim
163163
tensor = tensor[:, None, :, :] # [B,C=1,T,F]
164164

0 commit comments

Comments
 (0)