There is one option still, you may concat two tensors T and nogradT, and since concatenation is visible to autograd system, you may set T to requires grad and part of the nogradT not to have gradients. This way you will have gradients only for T.