RuntimeError: mean is not implemented for type torch.ByteTensor
I am getting this error after running my code:
&quot;RuntimeError: mean is not implemented for type torch.ByteTensor&quot;?
Do anyone know what I am doing wrong here?
accuracy = torch.mean(output)

Got it, basically torch.mean() isn't implemented on torch.ByteTensor so we can convert it to FloatTensor which is supported by torch.mean().
So the code will change to:
accuracy = torch.mean(output.type(torch.FloatTensor))
