Skip to content

Commit 1f49f6b

Browse files
committed
Fix to device
1 parent e4d5eab commit 1f49f6b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

deepvoice3_pytorch/modules.py

+1
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,5 @@ def get_mask_from_lengths(memory, memory_lengths):
237237
"""
238238
max_len = max(memory_lengths)
239239
mask = torch.arange(max_len).expand(memory.size(0), max_len) < torch.tensor(memory_lengths).unsqueeze(-1)
240+
mask = mask.to(memory.device)
240241
return ~mask

0 commit comments

Comments
 (0)