Unfortunately still got the same error 
Here’s the updated code:
if torch.cuda.is_available():
    print("Using the GPU")
    net = Net().cuda() # On GPU

for epoch in range(2):  # loop over the dataset multiple times

    running_loss = 0.0
    for i, data in enumerate(trainloader, 0):
        # get the inputs
        inputs, labels = data
        
        # wrap them in Variable
        use_cuda = torch.cuda.is_available()
        if use_cuda:
            inputs, labels = Variable(inputs.cuda()), Variable(labels.cuda())
            print('yes cuda')
        else:
            inputs, labels = Variable(inputs), Variable(labels)

        # zero the parameter gradients
        optimizer.zero_grad()

        # forward + backward + optimize
        outputs = net(inputs)
        
        if use_cuda:
            loss = criterion(outputs, labels).cuda()            
        else:
            loss = criterion(outputs, labels)
        #loss = criterion(outputs, labels)
        loss.backward()
        optimizer.step()

        # print statistics
        running_loss += loss.data[0]
        if i % 2000 == 1999:    # print every 2000 mini-batches
            print('[%d, %5d] loss: %.3f' %
                  (epoch + 1, i + 1, running_loss / 2000))
            running_loss = 0.0

print('Finished Training')

I’m wondering if anyone can run the example code just fine? http://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#training-on-gpu 3