(self, x: torch.FloatTensor, return_dict: bool = True)
| 128 | |
| 129 | @apply_forward_hook |
| 130 | def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> VQEncoderOutput: |
| 131 | h = self.encoder(x) |
| 132 | h = self.quant_conv(h) |
| 133 | |
| 134 | if not return_dict: |
| 135 | return (h,) |
| 136 | |
| 137 | return VQEncoderOutput(latents=h) |
| 138 | |
| 139 | @apply_forward_hook |
| 140 | def decode( |