Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-line-length = 120
ignore = E305,E402,E721,E741,F405,W503,W504,F999
exclude = build,docs/source,_ext,third_party
exclude = build,docs/source,_ext,third_party,examples/gallery
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ instance/
# Sphinx documentation
docs/_build/
docs/src/
docs/source/auto_examples
docs/source/gen_modules

# PyBuilder
target/
Expand Down
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ sphinxcontrib.katex
sphinxcontrib.bibtex
matplotlib
pyparsing<3,>=2.0.2
sphinx_gallery
IPython
deep-phonemizer
2 changes: 2 additions & 0 deletions docs/source/backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
torchaudio.backend
==================

.. py:module:: torchaudio.backend

Overview
~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions docs/source/compliance.kaldi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ torchaudio.compliance.kaldi

.. currentmodule:: torchaudio.compliance.kaldi

.. py:module:: torchaudio.compliance.kaldi

The useful processing operations of kaldi_ can be performed with torchaudio.
Various functions with identical parameters are given so that torchaudio can
produce similar outputs.
Expand Down
14 changes: 14 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'sphinx.ext.viewcode',
'sphinxcontrib.katex',
'sphinxcontrib.bibtex',
'sphinx_gallery.gen_gallery',
]

# katex options
Expand All @@ -58,6 +59,19 @@

bibtex_bibfiles = ['refs.bib']

sphinx_gallery_conf = {
'examples_dirs': [
'../../examples/gallery/wav2vec2',
],
'gallery_dirs': [
'auto_examples/wav2vec2',
],
'filename_pattern': 'tutorial.py',
'backreferences_dir': 'gen_modules/backreferences',
'doc_module': ('torchaudio',),
}
autosummary_generate = True

napoleon_use_ivar = True
napoleon_numpy_docstring = False
napoleon_google_docstring = True
Expand Down
2 changes: 2 additions & 0 deletions docs/source/datasets.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
torchaudio.datasets
====================

.. py:module:: torchaudio.datasets

All datasets are subclasses of :class:`torch.utils.data.Dataset`
and have ``__getitem__`` and ``__len__`` methods implemented.
Hence, they can all be passed to a :class:`torch.utils.data.DataLoader`
Expand Down
2 changes: 2 additions & 0 deletions docs/source/functional.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
torchaudio.functional
=====================

.. py:module:: torchaudio.functional
Comment on lines +7 to +8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the function of adding it for sphinx-gallery?

Copy link
Contributor Author

@mthrok mthrok Nov 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows to refer to the module as a whole from examples, like :py:mod:torchaudio.functional.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Looks nice.

.. currentmodule:: torchaudio.functional

Functions to perform common audio operations.
Expand Down
5 changes: 5 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ The :mod:`torchaudio` package consists of I/O, popular datasets and common audio
utils
prototype

.. toctree::
:maxdepth: 2
:caption: Tutorials

auto_examples/wav2vec2/index

.. toctree::
:maxdepth: 1
Expand Down
2 changes: 2 additions & 0 deletions docs/source/kaldi_io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
torchaudio.kaldi_io
======================

.. py:module:: torchaudio.kaldi_io

.. currentmodule:: torchaudio.kaldi_io

To use this module, the dependency kaldi_io_ needs to be installed.
Expand Down
2 changes: 2 additions & 0 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
torchaudio.models
=================

.. py:module:: torchaudio.models

.. currentmodule:: torchaudio.models

The models subpackage contains definitions of models for addressing common audio tasks.
Expand Down
8 changes: 8 additions & 0 deletions docs/source/pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ torchaudio.pipelines

.. currentmodule:: torchaudio.pipelines

.. py:module:: torchaudio.pipelines

The pipelines subpackage contains API to access the models with pretrained weights, and information/helper functions associated the pretrained weights.

wav2vec 2.0 / HuBERT - Representation Learning
Expand Down Expand Up @@ -73,13 +75,19 @@ HUBERT_XLARGE
wav2vec 2.0 / HuBERT - Fine-tuned ASR
-------------------------------------

Wav2Vec2ASRBundle
~~~~~~~~~~~~~~~~~

.. autoclass:: Wav2Vec2ASRBundle
:members: sample_rate

.. automethod:: get_model

.. automethod:: get_labels

.. minigallery:: torchaudio.pipelines.WAV2VEC2_ASR_BASE_960H
:add-heading: Examples using ``Wav2Vec2ASRBundle``
:heading-level: ~

WAV2VEC2_ASR_BASE_10M
~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions docs/source/prototype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
torchaudio.prototype.emformer
=============================

.. py:module:: torchaudio.prototype.emformer

.. currentmodule:: torchaudio.prototype.emformer

Emformer is a prototype feature; see `here <https://pytorch.org/audio>`_
Expand Down
2 changes: 2 additions & 0 deletions docs/source/sox_effects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
torchaudio.sox_effects
======================

.. py:module:: torchaudio.sox_effects

.. currentmodule:: torchaudio.sox_effects

Resource initialization / shutdown
Expand Down
2 changes: 2 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
torchaudio.transforms
======================

.. py:module:: torchaudio.transforms

.. currentmodule:: torchaudio.transforms

Transforms are common audio transforms. They can be chained together using :class:`torch.nn.Sequential`
Expand Down
2 changes: 2 additions & 0 deletions docs/source/utils.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
torchaudio.utils
================

.. py:module:: torchaudio.utils

torchaudio.utils.sox_utils
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
3 changes: 3 additions & 0 deletions examples/gallery/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.*
!*.rst
!*.py
2 changes: 2 additions & 0 deletions examples/gallery/wav2vec2/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Wav2Vec2 Tutorials
==================
Loading