From fbd83331b7051c26460cfbc7c54542c29e685eda Mon Sep 17 00:00:00 2001 From: lucidrains Date: Tue, 27 Feb 2024 13:56:49 -0800 Subject: [PATCH] address https://github.com/lucidrains/soundstorm-pytorch/issues/29 --- setup.py | 2 +- soundstorm_pytorch/soundstorm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 188183b..f3a316a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name = 'soundstorm-pytorch', packages = find_packages(exclude=[]), - version = '0.4.1', + version = '0.4.2', license='MIT', description = 'SoundStorm - Efficient Parallel Audio Generation from Google Deepmind, in Pytorch', author = 'Phil Wang', diff --git a/soundstorm_pytorch/soundstorm.py b/soundstorm_pytorch/soundstorm.py index 4d157ab..f5cdecc 100644 --- a/soundstorm_pytorch/soundstorm.py +++ b/soundstorm_pytorch/soundstorm.py @@ -97,7 +97,7 @@ def get_mask_subset_prob( logits = torch.rand((batch, seq), device = device) logits = logits.masked_fill(~mask, -1) - randperm = logits.argsort(dim = -1).float() + randperm = logits.argsort(dim = -1).argsort(dim = -1).float() num_padding = (~mask).sum(dim = -1, keepdim = True) randperm -= num_padding