A related question: Say I want to construct a tensor of the following form:
[[σ , 0,  -κ],
 [0,   κ,  0],
 [-κ,   0,   λ⁴σ]])

where κ is a function of two nn.Parameter L and σ and λ is a function of L. When I construct the tensor by using the parameters directly, it seems like the same thing happens, no gradient updates.
It works, however, when I construct single rows of the tensor (e.g. [0, 1, 0] * κ for the second row) individually. Once I created all rows by multiplying with the Parameters and concatenating, I get gradient updates. Is this really the best way to construct such tensors? Seems like this leads to a slightly more complex computation graph that it needs to be?