You probably get this error when you try to use the ByteTensor as a boolean:
RuntimeError: bool value of non-empty torch.ByteTensor objects is ambiguous
One possibility is to use (x>0).numpy() if your tensor only contains one single element.