I have a tensor called state of shape torch.Size([N, 2**n, 2**n]), and I want to apply the following operations:
state[[0,1]] = state[[1,0]]
state[0] = -1*state[0]
Both of these are in-place operations. Are there some out-of-place operations that I can substitute them with? These lines are inside a for-loop, so it would be a bit difficult to just create new variables.