I also like @Superklez’s approach for the same mentioned reason. In case you just want to assign known values to a single layer, I would probably use “Method 1”.
While your approaches would work fine, I would not recommend to use the .data attribute in any of them, as it might yield unwanted side effects. You could assign a new nn.Parameter to the weight attribute directly (and by wrapping it into a with torch.no_grad() block if necessary), use the nn.init methods as seen in @Superklez’s code, or the .copy_ method in case you want to assign the values directly to a parameter.