Solved by SimonW in post #2 
              
              
                These are basically python tricks. In Python, when you assign something as an attribute of an object, the object’s __setattr__ method will be called. For nn.Module, the method is overriden at https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/module.py#L400. 
super(Model, self).__init__…