Conversation
torchaudio/backend/sox_io_backend.py
Outdated
|
|
||
|
|
||
| @_mod_utils.requires_sox() | ||
| @_mod_utils.requires_module('torchaudio._torchaudio') |
There was a problem hiding this comment.
I think the logic of requires_sox contains that of requires_module('torchaudio._torchaudio'), so we should be able to replace 'torchaudio._torchaudio'.
| @@ -0,0 +1,17 @@ | |||
| #include <torch/script.h> | |||
|
|
|||
| namespace { | |||
There was a problem hiding this comment.
can you add torchaudio namespace too?
torchaudio/sox_effects/__init__.py
Outdated
| @@ -1,4 +1,4 @@ | |||
| from torchaudio._internal import module_utils as _mod_utils | |||
| from torchaudio._internal.module_utils import is_sox_available | |||
There was a problem hiding this comment.
The reason why we adopted the import pattern of from torchaudio._internal import module_utils as _mod_utils is that the whole module (and functions inside of it) is intended for internal use, so we do not want to expose it in other module.
from torchaudio._internal.module_utils import is_sox_available makes the helper function accessible like torchaudio.XXX.is_sox_available. Of course this is not a documented function and it should not be used by users, but we want to be careful about it. This is because at the beginning of torchaudio project, many helper functions were defined in __init__.py without under score prefix and it was messy/confusing. If we import individual functions from internal module, users cannot tell from the outside of the package that the function resides in the internal module, thus not for users to use.
There was a problem hiding this comment.
Of course, you can do from torchaudio._internal.module_utils import is_sox_available as _is_sox_available too.
* Update spaCy model download to full name Short 'en' and 'de' names has been deprecated since spaCy 3.0, so use fullname instead as suggested by the warning: ``` [!] As of spaCy v3.0, shortcuts like 'en' are deprecated. Pleaseuse the full pipeline package name 'en_core_web_sm' instead. [!] As of spaCy v3.0, shortcuts like 'de' are deprecated. Pleaseuse the full pipeline package name 'de_core_news_sm' instead. ``` * Add retries to window build downloads * Also, pin spacy version
support functionality to exclude libsox from C++ extension, so that we can eventually support C++ extension on Windows
BUILD_SOX=0to exclude libsox from being built + bound, different from the current implementation (dynamic build if =0)testing:
pytest torchaudio_unittestfor bothBUILDSOX=0andBUILDSOX=1cases