Hi
As you observed, the comparison operators return ByteTensor. I would even recommend to use .long() to convert to a LongTensor. You are safer from overflow even if you do calculations but more importantly it is the type that is most often used in pytorch when things expect integers (e.g. indexing, .gather,…).
If you need to do things with other tensors .float() is often needed (e.g. for batch averaging) with a mask or so as you can’t use operators with different tensor types in general.
Best regards
Thomas