Skip to content

Commit

Permalink
Update i6_models/primitives/mixup.py
Browse files Browse the repository at this point in the history
Co-authored-by: Albert Zeyer <[email protected]>
  • Loading branch information
Judyxujj and albertz authored May 23, 2024
1 parent 74a1933 commit 9c15fb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions i6_models/primitives/mixup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def get_random(self, b_dim: int, t_dim: int, max_num_mixup: int, n_mask: torch.t
start_indicies, n_mask
) # [B, M'] (M' denotes sum of num_mixup over the batch)

idx = torch.arange(t_dim)
idx = torch.unsqueeze(idx, dim=-1) + start_indicies_flat # [T, M']
idx = torch.arange(t_dim) # [T]
idx = idx[:, None] + start_indicies_flat[None, :] # [T, M']
mixup_values = self.cache[idx] # [T, M', F]
return mixup_values

Expand Down

0 comments on commit 9c15fb5

Please sign in to comment.