fix: move spectrogram to cpu when plotting

This commit is contained in:
Santiago Martinez 2023-04-29 15:39:45 +01:00
parent 616a24347d
commit 715db9a110

View File

@ -61,7 +61,7 @@ def spectrogram(
""" """
# Convert to numpy array if needed # Convert to numpy array if needed
if isinstance(spec, torch.Tensor): if isinstance(spec, torch.Tensor):
spec = spec.numpy() spec = spec.detach().cpu().numpy()
# Remove batch and channel dimensions if present # Remove batch and channel dimensions if present
spec = spec.squeeze() spec = spec.squeeze()