Since you won’t learn weight anymore, you don’t need it to be a parameter anymore. So you can do the following
mod = model._modules['0']
del mod.weight
mod.weight = w

You need to be careful though to delete .weight before it is passed to the optimizer.
And to populate it with a Tensor of the right size after that before calling the forward.