Sorry for reply late. I have tried using [:]
I tried out[0][0][0][0][:] where out is a 4 dimension array. all index set to 0 just as an example here.
But i got error
out[0][0][0][0][:] = 1
IndexError: dimension specified as 0 but tensor has no dimensions
So i tried to modify the whole tensor  with out[:] = torch.rand(out.size())
I found it is still
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: