Hi,
I’m afraid the require_grad is a property of the Tensor and you cannot set it for a subset of the Tensor.
The way I would recommend is just to save the values you want to keep and set them back after the optimizer step.
Other tricks like setting the gradients to 0 can be dangerous as optimizers with weight decay for example will still update the weights when gradient is 0.
Another more complex version would be to have a custom layer that has only the learnable part as parameter. Then recreate the full weights based on the fixed values (in the forward!). Then call into the conv1d functional op with this weight.