Currently I load a pretrained 7 layered network model using the command.

myNet=torch.load(‘path_to_model’)

Now I want to retrain the pretrained weights in the first 5 layer and re initialize the last two layers to xavier init or any initialisation.
How is possible for me to do so?