-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Describe the bug
MONAI/monai/transforms/post/array.py
Lines 628 to 636 in 825b8db
img_ = self.get_stacked_torch(img) | |
if self.weights is not None: | |
self.weights = self.weights.to(img_.device) | |
shape = tuple(self.weights.shape) | |
for _ in range(img_.ndimension() - self.weights.ndimension()): | |
shape += (1,) | |
weights = self.weights.reshape(*shape) | |
img_ = img_ * weights / weights.mean(dim=0, keepdim=True) |
the current implementation keeps all the predictions which take up unnecessary space compared with maintaining an output and updating it in-place.