Skip to content

Commit

Permalink
Merge pull request #4941 from pyf98/fix
Browse files Browse the repository at this point in the history
Fix device mismatch error in GPU decoding with PyTorch 1.13
  • Loading branch information
mergify[bot] committed Feb 15, 2023
2 parents 78c93bc + 6bf7987 commit 9c7bde4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion espnet/nets/batch_beam_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,5 @@ def post_process(
for b in torch.nonzero(is_eos, as_tuple=False).view(-1):
hyp = self._select(running_hyps, b)
ended_hyps.append(hyp)
remained_ids = torch.nonzero(is_eos == 0, as_tuple=False).view(-1)
remained_ids = torch.nonzero(is_eos == 0, as_tuple=False).view(-1).cpu()
return self._batch_select(running_hyps, remained_ids)

0 comments on commit 9c7bde4

Please sign in to comment.