Hi,
I am afraid you won’t be able to do that.
The “requires_grad” property is associated with the whole Tensor. And cannot be set for subsets.
You have a few approaches here:

Compute the gradient for the full layer and then zero-out the gradients before doing the optimizer update
If your optimizer still update the value when there is 0 gradient, then it is simpler to store the original value of the rows you want to save. Then do the full gradient computation and update with the optimizer and then write back the rows that you didn’t want changed.
The last option is to have a different Tensor (that is going to be your Parameter) that contains all the rows that you want learnt. And at every forward, write this Tensor into a bigger Tensor that also contains the frozen entries. And do training with that.