In my neural network, there is a operation like:
x[i : j] = torch.mul(x[ i : j ], a)
where x has type: <class ‘torch.autograd.variable.Variable’> , and x.requires_grad = True
Then an error occur: in-place operations can be only used on variables that don’t share storage with any other variables, but detected that there are 2 objects sharing it
So, how can I achieve this calculation and the return value also can be updated??