Not too sure on that, but I do believe that this:
T.abs().sum().item() == 0
will be much faster than

a function that stops iterating through the tensor as soon as it finds the first nonzero element?

as loops/iterators are very very slow