Based on the error message and your code it seems as if you are trying to use a ByteTensor in a common model, which uses float32 by default.
You would have to make sure the input dtype is matching the model parameters, so transform the input to float32 and it should work (I don’t think many operations support ByteTensors).