For multiclass classification you should have an output tensor of size (batch, num_classes) while the target label tensor should be (a LongTensor) of size (batch), where batch is the number of samples.
To compute accuracy you should first compute a softmax in order to have probabilities of each class for each sample, i.e.:
probs = torch.softmax(out, dim=1)

Then you should select the most probable class for each sample, i.e.:
winners = probs.argmax(dim=1)

Now you can compare target with winners:
corrects = (winners == target)

And take the average over all samples:
accuracy = corrects.sum().float() / float( target.size(0) )

If you want to do this all in one you can do it like:
accuracy = (torch.softmax(out, dim=1).argmax(dim=1) == target).sum().float() / float( target.size(0) )