I’m sorry but that code is very ambiguous. As a python object you can set whatever as “self”. Self just indicates it’s an attribute of the object, this is not related to pytorch itself but python.
The pytorch way is to set nn.Module instances as attributes in init and call them during forward however this does not necessary mean that everything set as an attribute were a nn.Module.