code: def test_ignore_mask(
      inputs: _Input, args: Dict[str, Any], cat_dim: int
  ):
      """Test that the metric correctly ignores regions of the inputs that do not map to a know category ID."""
      preds = inputs.preds[0]
      target = inputs.target[0]
      value = panoptic_quality(preds, target, **args)
      ignored_regions = torch.zeros_like(preds)
      ignored_regions[..., 0] = 255
      preds_new = torch.cat([preds, preds], dim=cat_dim)
      target_new = torch.cat([target, ignored_regions], dim=cat_dim)
      value_new = panoptic_quality(preds_new, target_new, **args)
      assert value == value_new
  
file_path: torchmetrics/tests/unittests/detection/test_panoptic_quality.py
imports: from typing import Any, Dict
  import numpy
  import pytest
  import torch
  from torchmetrics.detection.panoptic_qualities import PanopticQuality
  from torchmetrics.functional.detection.panoptic_qualities import panoptic_quality
  from unittests import _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 7 for calling a global function with example usage: test_ignore_mask(inputs, args, cat_dim) without return types