you could do something like
layer.weight.data.fill_(random_weight)
layer.bias.data.fill_(random_bias)

then to save you it you would just go
torch.save(model.state_dict(), "new_model.pt")

The only problem with this is you have to set each layer individually.