MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/inferers/inferer.py:1194–1209  ·  view source on GitHub ↗
(
        self,
        scheduler: Scheduler,
        scale_factor: float = 1.0,
        ldm_latent_shape: list | None = None,
        autoencoder_latent_shape: list | None = None,
    )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 3

SpatialPadClass · 0.90
CenterSpatialCropClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected