Solved by pascal_notsawo in post #2 
              
              
                setattr just adds an attribute to a python class, and that’s all: you can use getattr to get this attribute. But it is not sufficient to be an attribute of a pytorch model to be a parameter of this model, no. 
To be a parameter of a pytorch model, it is necessary to be an instance of the class torch…