Use of tensor.sum() function

In the code as follows :-
acc = (prediction_cls.eq(y_test)).sum() / float (y_test.shape[0])

Here the output of print(prediction_cls.eq(y_test)) is [[ True],[ True],[ True],[ True],[False]…]

Which is a list of boolean values . How can we sum the boolean values using .sum?
Does .sum() function also performs Boolean additon?

Just consider True as 1 and False as 0.

For example torch.tensor([True, True]).sum() is equal to tensor(2).