class_docstr: Test class for `MultilabelSpecificity` metric.
class_docstr_tok: ["Test","class","for","`","MultilabelSpecificity","`","metric","."]
docstr: Test the differentiability of the metric, according to its `is_differentiable` attribute.
docstr_tok: ["Test","the","differentiability","of","the","metric",",","according","to","its","`","is_differentiable","`","attribute","."]
code: def test_multilabel_specificity_differentiability(self, inputs):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      preds, target = inputs
      self.run_differentiability_test(
          preds=preds,
          target=target,
          metric_module=MultilabelSpecificity,
          metric_functional=multilabel_specificity,
          metric_args={
              "num_labels": NUM_CLASSES,
              "threshold": THRESHOLD,
          },
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from sklearn.metrics import confusion_matrix
  from torch import Tensor, tensor
  from torchmetrics.classification.specificity import BinarySpecificity, MulticlassSpecificity, MultilabelSpecificity, Specificity
  from torchmetrics.functional.classification.specificity import binary_specificity, multiclass_specificity, multilabel_specificity
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES, THRESHOLD
  from unittests.classification.inputs import _binary_cases, _multiclass_cases, _multilabel_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, inject_ignore_index
label_desc: Use image node_id 3 for calling the TestMultilabelSpecificity obj's underlying member method code with example usage: obj.test_multilabel_specificity_differentiability(inputs) without return types