I am trying to do CIFAR10 tutorial on GPU. since, I am worling on windows machien I was getting an error BrokenPipeError: [Errno 32] Broken pipe which solved aftre wrap the code in if __name__=='__main__': main() , then I did check that is cuda available or not which is available.
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

# Assume that we are on a CUDA machine, then this should print a CUDA device:
print(device)

and I added the net.to(device). then I added the second line to send the inputs and targets at every step to the GPU too,
inputs, labels = data
inputs, labels = inputs.to(device), labels.to(device)


but I got an error

  File "C:\Users\Neda\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 301, in forward
    self.padding, self.dilation, self.groups)

RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

thank you in advance.