Description
Describe the bug
The latent space of the autoencoder can be padded (to avoid it not being multiple of 2**(num_downsamplings) on the DM). When save_intermediates is False, the code still tries to crop them, even though they aren't created.
To Reproduce
- Create diffusion model
- Create inferer with ldm_latent_shape and autoencoder_latent_shape different
- Run the sample function with save_intermediates = False.
Expected behavior
No error.
Environment
Python 3.9
MONAI 1.4.0