What is the easiest way to check that a torch tensor’s dtype is an integer type?
I ultimately don’t care if it is torch.uint8 or torch.int32 for example, I just want to know if it contains integers.
I also don’t care on which device it is located
I could write something like
tensor.dtype in (torch.int8, torch.uint8, torch.int16,...)
But I was wondering if there was a more elegant way