Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About def get_mask_from_lengths(lengths, max_len=None): #24

Closed
Dyongh613 opened this issue May 9, 2022 · 0 comments
Closed

About def get_mask_from_lengths(lengths, max_len=None): #24

Dyongh613 opened this issue May 9, 2022 · 0 comments

Comments

@Dyongh613
Copy link

Hi@keonlee9420, Thank You very much!
def get_mask_from_lengths(lengths, max_len=None):
batch_size = lengths.shape[0]
if max_len is None:
max_len = torch.max(lengths).item()

ids = torch.arange(0, max_len).unsqueeze(
    0).expand(batch_size, -1).to(lengths.device)
mask = ids >= lengths.unsqueeze(1).expand(-1, max_len)

return ~mask

In PortaSpeech, the return is ~mask, while in DiffGAN-TTS it is mask. I want to know the difference between them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant