class_docstr: Test class for `MultilabelExactMatch` metric.
class_docstr_tok: ["Test","class","for","`","MultilabelExactMatch","`","metric","."]
docstr: Test functional implementation of metric.
docstr_tok: ["Test","functional","implementation","of","metric","."]
code: def test_multilabel_exact_match_functional(
      self, inputs, ignore_index, multidim_average
  ):
      """Test functional implementation of metric."""
      preds, target = inputs
      if ignore_index == -1:
          target = inject_ignore_index(target, ignore_index)
      if multidim_average == "samplewise" and preds.ndim < 4:
          pytest.skip(
              "samplewise and non-multidim arrays are not valid"
          )
  
      self.run_functional_metric_test(
          preds=preds,
          target=target,
          metric_functional=multilabel_exact_match,
          reference_metric=partial(
              _baseline_exact_match_multilabel,
              ignore_index=ignore_index,
              multidim_average=multidim_average,
          ),
          metric_args={
              "num_labels": NUM_CLASSES,
              "threshold": THRESHOLD,
              "ignore_index": ignore_index,
              "multidim_average": multidim_average,
          },
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from torchmetrics.classification.exact_match import ExactMatch, MulticlassExactMatch, MultilabelExactMatch
  from torchmetrics.functional.classification.exact_match import multiclass_exact_match, multilabel_exact_match
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES, THRESHOLD
  from unittests.classification.inputs import _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 2 for calling the TestMultilabelExactMatch obj's underlying member method code with example usage: obj.test_multilabel_exact_match_functional(inputs, ignore_index, multidim_average) without return types