diff --git a/noisereduce/spectralgate/__init__.py b/noisereduce/spectralgate/__init__.py index 8d22102..7611305 100644 --- a/noisereduce/spectralgate/__init__.py +++ b/noisereduce/spectralgate/__init__.py @@ -1,3 +1,9 @@ from .nonstationary import SpectralGateNonStationary from .stationary import SpectralGateStationary -from .streamed_torch_gate import StreamedTorchGate +try: + import torch + TORCH_AVAILABLE = True +except ImportError: + TORCH_AVAILABLE = False +if TORCH_AVAILABLE: + from .streamed_torch_gate import StreamedTorchGate