Skip to content

Commit

Permalink
Update frame_reducer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenaxie authored Dec 7, 2023
1 parent 2be6fc3 commit 10f65e1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ def forward(
limit_lens = x_lens - y_lens
max_limit_len = limit_lens.max().int()
ctc_prob = ctc_output.exp()
ctc_prob = ctc_prob.masked_fill(
padding_mask.unsqueeze(-1), 0.0,
)
fake_limit_indexes = torch.topk(
ctc_prob[:, :, blank_id].masked_fill(padding_mask, 0.0),
k=max_limit_len,
ctc_prob[:, :, blank_id], max_limit_len
).indices
T_arange = (
torch.arange(max_limit_len)
Expand Down

0 comments on commit 10f65e1

Please sign in to comment.