From a513db50d05ff3b2275b4e6b086b8b0c070a715f Mon Sep 17 00:00:00 2001 From: Rafael Valle Date: Wed, 11 Dec 2019 16:53:20 -0800 Subject: [PATCH] utils.py: compatibility with new pytorch --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index c843d95..4395201 100644 --- a/utils.py +++ b/utils.py @@ -6,7 +6,7 @@ import torch 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