I think even (2) will work (provided self.rho_prior is defined before the layers are created), since objects of type nn.Parameter are mutable, and we are passing references to these objects into the Lasso_layer constructors. I don’t think parameters are being cloned here.
The one way to be sure is to construct a toy example and test … .