diff --git a/torchaudio/_extension.py b/torchaudio/_extension.py index c20202b25d..6bb217c684 100644 --- a/torchaudio/_extension.py +++ b/torchaudio/_extension.py @@ -11,7 +11,7 @@ def _init_extension(): warnings.warn('torchaudio C++ extension is not available.') return - suffix = 'dll' if os.name == 'nt' else 'so' + suffix = 'pyd' if os.name == 'nt' else 'so' path = Path(__file__).parent / 'lib' / f'libtorchaudio.{suffix}' # In case `torchaudio` is deployed with `pex` format, this file does not exist. # In this case, we expect that `libtorchaudio` is available somewhere diff --git a/torchaudio/csrc/CMakeLists.txt b/torchaudio/csrc/CMakeLists.txt index 26b387466a..2187abafa1 100644 --- a/torchaudio/csrc/CMakeLists.txt +++ b/torchaudio/csrc/CMakeLists.txt @@ -90,6 +90,10 @@ if(USE_CUDA) ) endif() +if (MSVC) + set_target_properties(libtorchaudio PROPERTIES SUFFIX ".pyd") +endif(MSVC) + install( TARGETS libtorchaudio LIBRARY DESTINATION lib