Describe the bug
SSIMLoss result does not have gradient
@PedroFerreiradaCosta
@wyli
To Reproduce
import torch
from monai.losses.ssim_loss import SSIMLoss
x = torch.ones([1,1,10,10])/2
y = torch.ones([1,1,10,10])/2
y.requires_grad_(True)
data_range = x.max().unsqueeze(0)
loss = SSIMLoss(spatial_dims=2)(x,y,data_range)
print(loss.requires_grad)
Expected behavior
loss.requires_grad will be False. But it should be True
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Ensuring you use the relevant python executable, please paste the output of:
python -c 'import monai; monai.config.print_debug_info()'
Additional context
Add any other context about the problem here.
Describe the bug
SSIMLoss result does not have gradient
@PedroFerreiradaCosta
@wyli
To Reproduce
Expected behavior
loss.requires_gradwill be False. But it should be TrueScreenshots
If applicable, add screenshots to help explain your problem.
Environment
Ensuring you use the relevant python executable, please paste the output of:
Additional context
Add any other context about the problem here.