Accuracy metrics: In the case of all class indices of a target tensor is 0, throwing error.
🐛 Bug
version: 0.9.0rc12
To Reproduce
Code sample
from pytorch_lightning.metrics.functional import accuracy

pred = torch.tensor([0, 1, 2, 3])
target = torch.tensor([0, 0, 0, 0])

# calculates accuracy across all GPUs and all Nodes used in training
accuracy(pred, target)
RuntimeError
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-16-5d9063513e76> in <module>
      5 
      6 # calculates accuracy across all GPUs and all Nodes used in training
----> 7 accuracy(pred, target)

~/anaconda3/envs/pl/lib/python3.7/site-packages/pytorch_lightning/metrics/functional/classification.py in accuracy(pred, target, num_classes, reduction)
    268     """
    269     if not (target > 0).any() and num_classes is None:
--> 270         raise RuntimeError("cannot infer num_classes when target is all zero")
    271 
    272     tps, fps, tns, fns, sups = stat_scores_multiple_classes(

RuntimeError: cannot infer num_classes when target is all zero
Expected output
tensor(0.2500)