I’m not sure to understand your use case properly, but it seems to me you would like to assign some linear compinations to your tensor.
Wouldn’t this work?
T = 2
x = torch.randn(T, T, T, 3)
x[0, 0, 0] = 0.
x[1, 1, 1] = x[1, 0, 0] + x[0, 1, 0] + x[0, 0, 1]
...