(
self,
scheduler: Scheduler,
scale_factor: float = 1.0,
ldm_latent_shape: list | None = None,
autoencoder_latent_shape: list | None = None,
)
| 1192 | """ |
| 1193 | |
| 1194 | def __init__( |
| 1195 | self, |
| 1196 | scheduler: Scheduler, |
| 1197 | scale_factor: float = 1.0, |
| 1198 | ldm_latent_shape: list | None = None, |
| 1199 | autoencoder_latent_shape: list | None = None, |
| 1200 | ) -> None: |
| 1201 | super().__init__(scheduler=scheduler) |
| 1202 | self.scale_factor = scale_factor |
| 1203 | if (ldm_latent_shape is None) ^ (autoencoder_latent_shape is None): |
| 1204 | raise ValueError("If ldm_latent_shape is None, autoencoder_latent_shape must be None, and vice versa.") |
| 1205 | self.ldm_latent_shape = ldm_latent_shape |
| 1206 | self.autoencoder_latent_shape = autoencoder_latent_shape |
| 1207 | if self.ldm_latent_shape is not None and self.autoencoder_latent_shape is not None: |
| 1208 | self.ldm_resizer = SpatialPad(spatial_size=self.ldm_latent_shape) |
| 1209 | self.autoencoder_resizer = CenterSpatialCrop(roi_size=self.autoencoder_latent_shape) |
| 1210 | |
| 1211 | def __call__( # type: ignore[override] |
| 1212 | self, |
nothing calls this directly
no test coverage detected