inversible_interface.py 348 B

1234567891011121314
  1. from abc import ABC
  2. from abc import abstractmethod
  3. from typing import Tuple
  4. import torch
  5. class InversibleInterface(ABC):
  6. @abstractmethod
  7. def inverse(
  8. self, input: torch.Tensor, input_lengths: torch.Tensor = None
  9. ) -> Tuple[torch.Tensor, torch.Tensor]:
  10. # return output, output_lengths
  11. raise NotImplementedError