Source code for espnet2.tts2.feats_extract.abs_feats_extract
from abc import ABC, abstractmethod
from typing import Any, Dict, Tuple
import torch
[docs]class AbsFeatsExtractDiscrete(torch.nn.Module, ABC):
"""
Parse the discrete token sequence into structured data format for
predicting. E.g.,
(1) keep as sequence
(2) resize as a matrix
(3) multi-resolution ...
"""
[docs] @abstractmethod
def forward(
self, input: torch.Tensor, input_lengths: torch.Tensor
) -> Tuple[Any, Dict]:
raise NotImplementedError