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 列表) – 輸入文字。 返回: Tensor編碼後的文字。形狀: (batch, max length) Tensor批次中每個樣本的有效長度。形狀: (batch, )。 返回型別: (Tensor, Tensor)