Thanks for the clarification. According to that, I think it is not a problem to copy the weights and bias terms using .data. The problem appears if I want to use .data to copy parameters in the model because autograd will not propagate correctly towards the variable that has been copied.
However, still I have the doubt whether is possible to cancel the gradient for one specific weight inside a FC layer (or any other kind of layer in fact) or not. I see that if I cancel the gradient using one specific weight, let’s say
value.data[0].requires_grad = False
it seems (just looking the code line) that I have cancelled only the gradient just for this weight. However, after this operation, all the rest of the weights also appear with requires_grad False.
print(value.data[1].requires_grad)
returns False even though they were initially set as True. So, I conclude that it is not possible, which in fact seems reasonable but I find a little bit confusing that I can do
value.data[0].requires_grad = False
without any warning.