Compare Number of Equal Elements in Tensors
Something like
equal_count = len((tensor_1.flatten() == tensor_2.flatten()).nonzero().flatten())
should work.
I have two tensors of dimension 1000 * 1. I want to check how many of the 1000 elements are equal in the two tensors. I think I should be able to do this in one line like Numpy but couldn't find a similar function.