If I construct b=nn.Parameter(a), I wouldn’t get the gradient w.r.t a, because of call to nn.Parameter breaks the computational graph and b will be a leaf of the graph. (Maybe I’m mistaking, but my experiments showed that it works like this)
In MyChild class b should be the function of a. So b shouldn’t be updated via optimizer. But gradient should flow throw b, because I will update a