Tacotron2TTSBundle.TextProcessor¶
- class torchaudio.pipelines.Tacotron2TTSBundle.TextProcessor¶
Interface of the text processing part of Tacotron2TTS pipeline
See
torchaudio.pipelines.Tacotron2TTSBundle.get_text_processor()
for the usage.
Properties¶
tokens¶
Methods¶
__call__¶
- abstract TextProcessor.__call__(texts: Union[str, List[str]]) Tuple[Tensor, Tensor] ¶
Encode the given (batch of) texts into numerical tensors
- Parameters:
text (str or list of str) – The input texts.
- Returns:
- Tensor:
The encoded texts. Shape: (batch, max length)
- Tensor:
The valid length of each sample in the batch. Shape: (batch, ).
- Return type:
(Tensor, Tensor)