I found the solution so I write it here for the record.
As correctly mentioned by @pascal.soveaux the test_tensor_2 = test_tensor; operation caused the problem. I changed it into
test_tensor_2.copy_(test_tensor);

and it now works when using just after
test_tensor.zero_();

Thanks everyone for the help!