Skip to content

Commit f3e0ad8

Browse files
authored
Cast tensor in Delay to audio tensor's device
1 parent f152b78 commit f3e0ad8

File tree

1 file changed

+1
-1
lines changed
  • torchaudio_augmentations/augmentations

1 file changed

+1
-1
lines changed

torchaudio_augmentations/augmentations/delay.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def forward(self, audio):
2828
)
2929

3030
offset = self.calc_offset(ms)
31-
beginning = torch.zeros(audio.shape[0], offset)
31+
beginning = torch.zeros(audio.shape[0], offset).to(audio.device)
3232
end = audio[:, :-offset]
3333
delayed_signal = torch.cat((beginning, end), dim=1)
3434
delayed_signal = delayed_signal * self.volume_factor

0 commit comments

Comments
 (0)