Skip to content

Commit

Permalink
backward compatibility for RandAffined
Browse files Browse the repository at this point in the history
  • Loading branch information
wyli authored Jul 28, 2023
1 parent d452bd1 commit 436bca6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions monai/transforms/spatial/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ def __call__(
grid = self.rand_affine.get_identity_grid(sp_size, lazy=lazy_)
if self._do_transform: # add some random factors
grid = self.rand_affine.rand_affine_grid(sp_size, grid=grid, lazy=lazy_)
grid = 0 if grid is None else grid # always provide a grid to self.rand_affine

for key, mode, padding_mode in self.key_iterator(d, self.mode, self.padding_mode):
# do the transform
Expand Down

0 comments on commit 436bca6

Please sign in to comment.