eq pytorch code example Example 1: torch tensor equal to torch.all(torch.eq(tens_a, tens_b)) Example 2: torch tensor equal to torch.all(tens_a.eq(tens_b))