Skip to content

Commit 97fe8f1

Browse files
nateanlfacebook-github-bot
authored andcommitted
Import torchaudio #1711 2c11582
Summary: as titled Reviewed By: carolineechen Differential Revision: D30449599 fbshipit-source-id: 7b3faaf6d7dbfa2e5ca9c263554b18e7364be77e
1 parent 1da8b57 commit 97fe8f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1030
-672
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif()
5656
# Options
5757
option(BUILD_SOX "Build libsox statically" OFF)
5858
option(BUILD_KALDI "Build kaldi statically" ON)
59-
option(BUILD_RNNT "Enable RNN transducer" OFF)
59+
option(BUILD_RNNT "Enable RNN transducer" ON)
6060
option(BUILD_LIBTORCHAUDIO "Build C++ Library" ON)
6161
option(BUILD_TORCHAUDIO_PYTHON_EXTENSION "Build Python extension" OFF)
6262
option(USE_CUDA "Enable CUDA support" OFF)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ conda install -y -c pytorch-nightly torchaudio
8282

8383
The build process builds libsox and some codecs that torchaudio need to link to. This is achieved by setting the environment variable `BUILD_SOX=1`.
8484
The build process will fetch and build libmad, lame, flac, vorbis, opus, and libsox before building extension. This process requires `cmake` and `pkg-config`.
85+
The build process also builds the RNN transducer loss. This functionality can be disabled by setting the environment variable `BUILD_RNNT=0`.
8586

8687
```bash
8788
# Linux

build_tools/setup_helpers/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _get_build(var, default=False):
3636

3737
_BUILD_SOX = False if platform.system() == 'Windows' else _get_build("BUILD_SOX")
3838
_BUILD_KALDI = False if platform.system() == 'Windows' else _get_build("BUILD_KALDI", True)
39-
_BUILD_RNNT = _get_build("BUILD_RNNT")
39+
_BUILD_RNNT = _get_build("BUILD_RNNT", True)
4040
_USE_ROCM = _get_build("USE_ROCM")
4141
_USE_CUDA = _get_build("USE_CUDA", torch.cuda.is_available())
4242

docs/source/functional.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ vad
211211

212212
.. autofunction:: spectrogram
213213

214+
:hidden:`inverse_spectrogram`
215+
-----------------------------
216+
217+
.. autofunction:: inverse_spectrogram
218+
214219
:hidden:`griffinlim`
215220
--------------------
216221

@@ -251,6 +256,14 @@ vad
251256

252257
.. autofunction:: spectral_centroid
253258

259+
:hidden:`Loss`
260+
~~~~~~~~~~~~~~
261+
262+
rnnt_loss
263+
---------
264+
265+
.. autofunction:: rnnt_loss
266+
254267
References
255268
~~~~~~~~~~
256269

docs/source/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ The :mod:`torchaudio` package consists of I/O, popular datasets and common audio
3939
compliance.kaldi
4040
kaldi_io
4141
utils
42-
rnnt_loss
43-
tacotron2
4442

4543

4644
.. toctree::

docs/source/models.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ DeepSpeech
2525
.. automethod:: forward
2626

2727

28+
Tacotron2
29+
~~~~~~~~~
30+
31+
.. autoclass:: Tacotron2
32+
33+
.. automethod:: forward
34+
35+
.. automethod:: infer
36+
37+
Factory Functions
38+
-----------------
39+
40+
tacotron2
41+
---------
42+
43+
.. autofunction:: tacotron2
44+
45+
2846
Wav2Letter
2947
~~~~~~~~~~
3048

docs/source/rnnt_loss.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/source/transforms.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ Transforms are common audio transforms. They can be chained together using :clas
1616

1717
.. automethod:: forward
1818

19+
:hidden:`InverseSpectrogram`
20+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
22+
.. autoclass:: InverseSpectrogram
23+
24+
.. automethod:: forward
25+
1926
:hidden:`GriffinLim`
2027
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2128

@@ -164,6 +171,12 @@ Transforms are common audio transforms. They can be chained together using :clas
164171

165172
.. automethod:: forward
166173

174+
:hidden:`RNNTLoss`
175+
~~~~~~~~~~~~~~~~~~
176+
177+
.. autoclass:: RNNTLoss
178+
179+
.. automethod:: forward
167180

168181
References
169182
~~~~~~~~~~

examples/libtorchaudio/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SET(BUILD_LIBTORCHAUDIO ON CACHE BOOL "Build libtorchaudio")
66
SET(BUILD_SOX ON CACHE BOOL "Build libsox into libtorchaudio")
77

88
SET(BUILD_KALDI OFF CACHE BOOL "Build Kaldi into libtorchaudio")
9-
SET(BUILD_RNNT OFF CACHE BOOL "Build RNN transducer into libtorchaudio")
9+
SET(BUILD_RNNT ON CACHE BOOL "Build RNN transducer into libtorchaudio")
1010
SET(BUILD_TORCHAUDIO_PYTHON_EXTENSION OFF CACHE BOOL "Build Python binding")
1111

1212
find_package(Torch REQUIRED)

examples/libtorchaudio/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ cmake -GNinja \
2222
-DCMAKE_PREFIX_PATH="$(python -c 'import torch;print(torch.utils.cmake_prefix_path)')" \
2323
-DBUILD_SOX=ON \
2424
-DBUILD_KALDI=OFF \
25+
-DBUILD_RNNT=ON \
2526
..
2627
cmake --build .
2728
```

0 commit comments

Comments
 (0)