Thanks for your reply
you pointed conditions are based on the modified weights instead of the original weight
Consequently, The result was the same when I replaced modified values with original weights in torch.where() condition.
And the second part, then If I initialize like
self.dw = nn.Parameter(torch.rand(1),requires_grad=True) # 0 ~ 1 real values

I think ‘self.dw’ can be negative after backpropagation.