Hyo:

I have 100 classes and I am using BCEWithLogitsLoss


What do you mean you have 100 classes?



 Hyo:

Labels :  torch.tensor([0,1,0,1,0.......,1])


You probably meant, you have 2 classes (or one, depends on how you look at it) 0 and 1.
One way to calculate accuracy would be to round your outputs. This would make 0.5 the classification border.
correct = 0.
total = 0.
with torch.no_grad():
    #get testing data from data_loader
    for data in test_loader:
        #get images and labels
        images, labels = data
        #move data to gpu
        images = images.to(device)
        #send data through the network and save outputs
        outputs = net(images)
        #map outputs to range of 0-1
        outputs = torch.sigmoid(outputs).cpu()        #<--- since you use BCEWithLogitsLoss
        #round up and down to either 1 or 0
        predicted = np.round(outputs) #keep in mind that np.round() is a round to even function
        total += labels.size(0)
        #calculate how many images were correctly classified
        correct += (predicted == labels).sum().item()
accuracy = 100 * correct / total
print("Accuracy: {}%".format(accuracy))

Since you are using BCEWithLogitsLoss and not BCELoss I am assuming you do not have a sigmoid layer in your net. This is why I put a sigmoid function in there.