Skip to content

Commit

Permalink
Frontends: Add tensor info to assert (#43)
Browse files Browse the repository at this point in the history
* add tensor info to assert

---------

Co-authored-by: Albert Zeyer <[email protected]>
  • Loading branch information
Atticus1806 and albertz authored Dec 8, 2023
1 parent 933c6c1 commit 087d485
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion i6_models/parts/frontend/generic_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __init__(self, model_cfg: GenericFrontendV1Config):
)

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

Expand Down
2 changes: 1 addition & 1 deletion i6_models/parts/frontend/vgg_act.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def forward(self, tensor: torch.Tensor, sequence_mask: torch.Tensor) -> Tuple[to
:param sequence_mask: the sequence mask for the tensor
:return: torch.Tensor of shape [B,T",F'] and the shape of the sequence mask
"""
assert tensor.shape[-1] == self.cfg.in_features
assert tensor.shape[-1] == self.cfg.in_features, f"shape {tensor.shape} vs in features {self.cfg.in_features}"
# and add a dim
tensor = tensor[:, None, :, :] # [B,C=1,T,F]

Expand Down

0 comments on commit 087d485

Please sign in to comment.