Thanks for your answer. But wouldn’t layer.weight.data.fill_(random_weight) set all the values in that layer to the same value? What I want is to set each weight/bias to a random value within the range of (weight-2, weight+2 for example), and not all weights/biases from each layer to the exact same number. It should variate depending on the current values the model already has.