I am getting this error while returning the precision_score:
 from sklearn.metrics import  precision_score
 def calculate_precision(outputs, targets):
      batch_size = targets.size(0)

     _, pred = outputs.topk(1, 1, True)
     pred = pred.t()
     return  precision_score(targets.view(-1), pred.view(-1), average = 'macro')

Please help, I am new to pytorch. Thanks!