Thanks for your reply. In your solution, you created a new_w and assign the old way at specific locations. I can do it in this way.
Another concern is that whether I can use SGD to update the original weight after I created a new weight matrix from the original weight.