From 6fbba8ef0f612c166bca385636286d3fbf9db297 Mon Sep 17 00:00:00 2001 From: Raul Puri Date: Fri, 4 May 2018 10:14:30 -0700 Subject: [PATCH] mask utils update for 0.4 cuda --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 01046c3..633ecff 100644 --- a/utils.py +++ b/utils.py @@ -5,7 +5,7 @@ import torch def get_mask_from_lengths(lengths): max_len = torch.max(lengths) - ids = torch.arange(0, max_len, out=torch.LongTensor(max_len)).cuda() + ids = torch.arange(0, max_len).long().cuda() mask = (ids < lengths.unsqueeze(1)).byte() return mask