model_class.rst 3.5 KB
Newer Older
1
2
3
..
  autogenerated from source/_templates/autosummary/model_class.rst

4
5
6
7
.. currentmodule:: torchaudio.models

..

8
{%- set methods=["forward"] %}
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{%- set helpers={
        "torchaudio.models.RNNTBeamSearch": [
            "Hypothesis",
        ],
    }
-%}
{%- set factory={
        "torchaudio.models.ConvTasNet": [
            "conv_tasnet_base",
        ],
        "torchaudio.models.Wav2Vec2Model": [
            "wav2vec2_model",
            "wav2vec2_base",
            "wav2vec2_large",
            "wav2vec2_large_lv60k",
Zhaoheng Ni's avatar
Zhaoheng Ni committed
24
25
26
            "wav2vec2_xlsr_300m",
            "wav2vec2_xlsr_1b",
            "wav2vec2_xlsr_2b",
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
            "hubert_base",
            "hubert_large",
            "hubert_xlarge",
            "wavlm_model",
            "wavlm_base",
            "wavlm_large",
        ],
        "torchaudio.models.HuBERTPretrainModel": [
            "hubert_pretrain_model",
            "hubert_pretrain_base",
            "hubert_pretrain_large",
            "hubert_pretrain_xlarge",
        ],
        "torchaudio.models.RNNT": [
            "emformer_rnnt_model",
            "emformer_rnnt_base",
        ],
        "torchaudio.models.HDemucs": [
            "hdemucs_low",
            "hdemucs_medium",
            "hdemucs_high",
        ],
    }
-%}
51
52
53
54
55
56
57
58
59
60
61
62
63
{%- set prototype_factory = {
    "torchaudio.models.Wav2Vec2Model": [
        "emformer_hubert_model",
        "emformer_hubert_base",
        "conformer_wav2vec2_model",
        "conformer_wav2vec2_base",
    ],
    "torchaudio.models.RNNT": [
        "conformer_rnnt_model",
        "conformer_rnnt_base",
    ],
}
-%}
64
65
66
67
68
69
70
71
{%- set utils={
        "torchaudio.models.Wav2Vec2Model": [
            "~torchaudio.models.wav2vec2.utils.import_fairseq_model",
            "~torchaudio.models.wav2vec2.utils.import_huggingface_model",
        ]
    }
-%}

72
73
74
75
76
77
78
79
{%- if name in ["Wav2Vec2Model"] %}
  {{ methods.extend(["extract_features"]) }}
{%- elif name in ["Emformer", "RNNTBeamSearch", "WaveRNN", "Tacotron2", ] %}
  {{ methods.extend(["infer"]) }}
{%- elif name == "RNNT" %}
  {{ methods.extend(["transcribe_streaming", "transcribe", "predict", "join"]) }}
{%- endif %}

80
81
.. TITLE

82
83
{{ name | underline }}

84
85
.. CLASS DEFINITIONS

86
87
.. autoclass:: {{ fullname }}

88
89
90
Methods
=======

91
92
93
94
95
96
97
98
99
100
{% for item in methods %}

{{item | underline("-") }}

.. container:: py attribute

   .. automethod:: {{[fullname, item] | join('.')}}

{%- endfor %}

101
102
103
.. HELPER STRUCTURES

{%- if helpers[fullname] %}
104
105
106
107

Support Structures
==================

108
109
110
{%- for item in helpers[fullname] %}

{{item | underline("-") }}
111
112
113

.. container:: py attribute

114
   .. autodata:: {{["torchaudio.models", item] | join('.')}}
115
116
      :no-value:

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{%- endfor %}

{%- endif %}

.. FACTORY FUNCTIONS

{%- if factory[fullname] %}

Factory Functions
=================

.. autosummary::
   :toctree: ../generated
   :nosignatures:

{% for item in factory[fullname] %}
   {{["~torchaudio.models", item] | join('.')}}
{%- endfor %}

{%- endif %}

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.. PROTOTYPE FACTORY FUNCTIONS

{%- if prototype_factory[fullname] %}

Prototype Factory Functions
===========================

.. currentmodule:: torchaudio.prototype.models

.. autosummary::
   :toctree: ../generated
   :nosignatures:

{% for item in prototype_factory[fullname] %}
   {{["~torchaudio.prototype.models", item] | join('.')}}
{%- endfor %}

{%- endif %}

157
158
159
160
161
162
163
.. UTILITY FUNCTIONS

{%- if utils[fullname] %}

Utility Functions
=================

164
165
.. currentmodule:: torchaudio.models

166
167
168
169
170
171
172
173
.. autosummary::
   :toctree: ../generated
   :nosignatures:

{% for item in utils[fullname] %}
   {{ item }}
{%- endfor %}

174
{%- endif %}