def METHOD_NAME(self, self_rank, size, gathered_tensors, assertFunc):
    for other_rank in range(size):
        if self_rank != other_rank:
            assertFunc(
                self.get_tensor_slice(self_rank, size, gathered_tensors),
                self.get_tensor_slice(other_rank, size, gathered_tensors),
            )