(
self, x: torch.Tensor, return_dict: bool = True
)
| 668 | |
| 669 | @apply_forward_hook |
| 670 | def encode( |
| 671 | self, x: torch.Tensor, return_dict: bool = True |
| 672 | ) -> Union[AutoencoderKLOutput, Tuple[DiagonalGaussianDistribution]]: |
| 673 | h = self._encode(x) |
| 674 | |
| 675 | posterior = DiagonalGaussianDistribution(h) |
| 676 | |
| 677 | if not return_dict: |
| 678 | return (posterior,) |
| 679 | return AutoencoderKLOutput(latent_dist=posterior) |
| 680 | |
| 681 | def _decode(self, zs): |
| 682 | dec = [ |
no test coverage detected