code: def accuracy_multilabel(
      y_pred: Tensor, y_true: Tensor, sigmoid: bool = True, **kwargs
  ):
      if sigmoid:
          y_pred = y_pred.sigmoid()
      y_pred = y_pred.cpu()
      y_true = y_true.cpu()
      outputs = np.argmax(y_pred, axis=1)
      real_vals = np.argmax(y_true, axis=1)
      return np.mean(outputs.numpy() == real_vals.numpy())
  
file_path: fast-bert/fast_bert/metrics.py
imports: import numpy
  from torch import Tensor
  from sklearn.metrics import roc_curve, auc, hamming_loss, accuracy_score, confusion_matrix
  import pdb
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: accuracy_multilabel(y_pred, y_true, sigmoid) and returns: np