We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4d5eab commit 1f49f6bCopy full SHA for 1f49f6b
deepvoice3_pytorch/modules.py
@@ -237,4 +237,5 @@ def get_mask_from_lengths(memory, memory_lengths):
237
"""
238
max_len = max(memory_lengths)
239
mask = torch.arange(max_len).expand(memory.size(0), max_len) < torch.tensor(memory_lengths).unsqueeze(-1)
240
+ mask = mask.to(memory.device)
241
return ~mask
0 commit comments