Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix device (#4887)
Browse files Browse the repository at this point in the history
  • Loading branch information
klshuster committed Nov 21, 2022
1 parent 4ffb29c commit bbdd64b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parlai/core/torch_generator_agent.py
Expand Up @@ -1596,7 +1596,7 @@ def advance(self, logprobs, step):
hyp_device = self.partial_hyps.get_device()
self.partial_hyps = torch.cat(
(
self.partial_hyps[path_selection.hypothesis_ids.long()],
self.partial_hyps[path_selection.hypothesis_ids.long().to(hyp_device)],
path_selection.token_ids.view(path_selection.token_ids.shape[0], -1).to(
hyp_device
),
Expand Down

0 comments on commit bbdd64b

Please sign in to comment.