torchaudio-augmentations
torchaudio-augmentations copied to clipboard
Shapes are still a bit confusing
From ComposeMany.__call__()
, is x
also a ch, time
shape 2-dim tensor? And I'm sure what would be the expected behavior by this function, especially the shape of the output.
Yes, it's also (ch, time). The output of self.transform(x) is added to a list with an extra dimension (with unsqueeze), so that the subsequent torch.cat() will concatenate the vectors into a 3-dimensional tensor with: (batch, channels, time) https://github.com/Spijkervet/torchaudio-augmentations/blob/master/torchaudio_augmentations/compose.py#L41
This behavior is also tested in https://github.com/Spijkervet/torchaudio-augmentations/blob/master/tests/test_compose.py#L29
I see. How about adding it in the docstring? That would be more easily accessible for the users.