Skip to content

Commit

Permalink
Place biased_logits on device
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Dec 8, 2023
1 parent fd5af1a commit e0b3d87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outlines/generate/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def bias_logits(
A view of the original logits tensor where some values are masked.
"""
biased_logits = torch.empty(logits.shape)
biased_logits = torch.empty(logits.shape, device=logits.device)
for i, ids in enumerate(ids_to_mask):
mask = torch.full((logits.shape[-1],), -math.inf, device=logits.device)
mask[ids] = 0
Expand Down

0 comments on commit e0b3d87

Please sign in to comment.