Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Chih-Chiang Chang committed Jun 10, 2022
2 parents 331ccb1 + aaeb53c commit 6970623
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ def cif_function(
.scatter(
1,
feat_lengths.view(B, 1, 1).expand(-1, -1, C),
beta / tail_weights.view(B, 1, 1).expand(-1, -1, C),
beta / tail_weights.masked_fill(~extend_mask, beta).view(B, 1, 1).expand(-1, -1, C),
)
.detach()
)
output[extend_mask] *= upscale[extend_mask]
output *= upscale
feat_lengths += extend_mask.long()
T = feat_lengths.max()
output = output[:, :T, :]
Expand Down

0 comments on commit 6970623

Please sign in to comment.