Solved by SimonW in post #2 
              
              
                The reason is that Variable methods always return a size-1 tensor for scalar results. Since the type of t is ByteTensor, it unfortunately returns this. 
This is an known issue and will be fixed when we properly introduce scalar types. The issue is tracked here: https://github.com/pytorch/pytorch/iss…