Skip to content

Commit 56a010b

Browse files
authored
set libtorch audio suffix as pyd on Windows (#1788)
1 parent c69955c commit 56a010b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

torchaudio/_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def _init_extension():
1111
warnings.warn('torchaudio C++ extension is not available.')
1212
return
1313

14-
suffix = 'dll' if os.name == 'nt' else 'so'
14+
suffix = 'pyd' if os.name == 'nt' else 'so'
1515
path = Path(__file__).parent / 'lib' / f'libtorchaudio.{suffix}'
1616
# In case `torchaudio` is deployed with `pex` format, this file does not exist.
1717
# In this case, we expect that `libtorchaudio` is available somewhere

torchaudio/csrc/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ if(USE_CUDA)
9090
)
9191
endif()
9292

93+
if (MSVC)
94+
set_target_properties(libtorchaudio PROPERTIES SUFFIX ".pyd")
95+
endif(MSVC)
96+
9397
install(
9498
TARGETS libtorchaudio
9599
LIBRARY DESTINATION lib

0 commit comments

Comments
 (0)