devpouya:

I want to pass the entire tensor through a linear layer, but I only want one of the rows to be updated and the rest to remain the same


Question: Why do you want to pass the entire input through the linear layer if only one row needs to be transformed? Isn’t it a waste of computation?