def init_params(m):
  if type(m)==nn.Linear or type(m)==nn.Conv2d:
    m.weight.data=torch.randn(m.weight.size())*.01#Random weight initialisation
    m.bias.data=torch.zeros(m.bias.size())

#for setting the weights you can use:
Model.apply(init_params) #Model here is the model that you have created