It has no effect because a nn.Parameter() is always a leaf (so that its .grad field will be populated when doing .backward()). And so wrapping inside the Parameter breaks the differentiability. This is why the no_grad() has no effect.