Pytorch: Create an boolean tensor (type: torch.ByteTensor)?
Already found it:
a = torch.zeros(10)
b = a.type(torch.ByteTensor)
Isn't this more economical (albeit longer):
a = torch.zeros(10, dtype=torch.bool)
or, in older versions,
a = torch.zeros(10, dtype=torch.uint8)
(Thanks @drevicko for the pointer to bool.)