If we have a tensor like this
[[True, False, False,False],
[False,False,False,False],
[True,True,False,False],
[[True,True,True,True]]

The check should return True. But in case there is something like this
[[True, False, True,True], <--- wrong
[False,False,False,False],
[True,True,False,False],
[[True,True,True,True]]

should return False or maybe this
[[False, False, True,True], <--- wrong
[False,True,False,False], <--- wrong
[True,True,False,False],
[[True,True,True,True]]

How can one implement such a check in pytorch (I specifically meant not using a for loop because that won’t be a feasible check in a full fledged code)?