(self, x)
| 574 | return latent_size |
| 575 | |
| 576 | def encode(self, x): |
| 577 | time_padding = x.shape[2] % self.time_downsample_factor |
| 578 | if time_padding != 0: |
| 579 | time_padding = self.time_downsample_factor - time_padding |
| 580 | x = pad_at_dim(x, (time_padding, 0), dim=2) |
| 581 | encoded_feature = self.encoder(x) |
| 582 | moments = self.quant_conv(encoded_feature).to(x.dtype) |
| 583 | posterior = DiagonalGaussianDistribution(moments) |
| 584 | return posterior |
| 585 | |
| 586 | def decode(self, z, num_frames=None): |
| 587 | time_padding = num_frames % self.time_downsample_factor |
no test coverage detected