class_docstr: Test class for `MultilabelPrecisionRecallCurve` metric.
class_docstr_tok: ["Test","class","for","`","MultilabelPrecisionRecallCurve","`","metric","."]
docstr: Test that different types of `thresholds` argument lead to same result.
docstr_tok: ["Test","that","different","types","of","`","thresholds","`","argument","lead","to","same","result","."]
code: def test_multilabel_precision_recall_curve_threshold_arg(
      self, inputs, threshold_fn
  ):
      """Test that different types of `thresholds` argument lead to same result."""
      preds, target = inputs
      for pred, true in zip(preds, target):
          p1, r1, t1 = multilabel_precision_recall_curve(
              pred, true, num_labels=NUM_CLASSES, thresholds=None
          )
          for i, t in enumerate(t1):
              p2, r2, t2 = multilabel_precision_recall_curve(
                  pred,
                  true,
                  num_labels=NUM_CLASSES,
                  thresholds=threshold_fn(t),
              )
  
              assert torch.allclose(p1[i], p2[i])
              assert torch.allclose(r1[i], r2[i])
              assert torch.allclose(t1[i], t2)
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from scipy.special import softmax
  from sklearn.metrics import precision_recall_curve
  from torchmetrics.classification.precision_recall_curve import BinaryPrecisionRecallCurve, MulticlassPrecisionRecallCurve, MultilabelPrecisionRecallCurve, PrecisionRecallCurve
  from torchmetrics.functional.classification.precision_recall_curve import binary_precision_recall_curve, multiclass_precision_recall_curve, multilabel_precision_recall_curve
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES
  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, remove_ignore_index
label_desc: Use image node_id 6 for calling the TestMultilabelPrecisionRecallCurve obj's underlying member method code with example usage: obj.test_multilabel_precision_recall_curve_threshold_arg(inputs, threshold_fn) without return types