dongsup_kim:

and if I save the model with torch.save() function, the size of the saved model is quite big comparing to same model built with separate modules like nn.ReLU()


Are you comparing the saved state_dicts or are you saving the model directly?



 dongsup_kim:

If I build a model with pre defined modules with self variable, I think the modules are added several times and forward/backward paths as well


You could compare the intermediate activations of both models and should get the same output (up to an error of ~1e-6, which might be created due to the limited floating point precision).