Skip to content

Commit

Permalink
utils.py: compatibility with new pytorch
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelvalle committed Dec 12, 2019
1 parent 37a033d commit a513db5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils.py
Expand Up @@ -6,7 +6,7 @@
def get_mask_from_lengths(lengths):
max_len = torch.max(lengths).item()
ids = torch.arange(0, max_len, out=torch.cuda.LongTensor(max_len))
mask = (ids < lengths.unsqueeze(1)).byte()
mask = (ids < lengths.unsqueeze(1)).bool()
return mask


Expand Down

0 comments on commit a513db5

Please sign in to comment.