Right now, I have a use case like following
A is a torch.tensor like following
A =
[[1,x,y],
[1,2,3],
[1,z,3]]
only elements x, y, z in A are differentiable, other elements are just constant.
For example, if the cost = tr(A.A)
cost = 14 + 2 x + 2 y + 6 z
When I do backtracking, I only want to differentiate and update with respect to x, y, z. Certainly this example is just a toy example, not the true complicated one.
How can I realize such use case?