Tacotron2TTSBundle.TextProcessor¶ class torchaudio.pipelines.Tacotron2TTSBundle.TextProcessor¶ Tacotron2TTS pipeline的文本处理部分接口 使用方法请参见 torchaudio.pipelines.Tacotron2TTSBundle.get_text_processor()。 属性¶ tokens¶ abstract property TextProcessor.tokens¶ 每个处理后的张量值所代表的 token。 类型 List[str] 方法¶ __call__¶ abstract TextProcessor.__call__(texts: Union[str, List[str]]) → Tuple[Tensor, Tensor]¶ 将给定的(一批)文本编码为数值张量 参数 text (str 或 str 列表) – 输入文本。 返回 张量编码后的文本。形状:(batch, max length) 张量批次中每个样本的有效长度。形状:(batch, )。 返回类型 (Tensor, Tensor)