class_docstr: Test class collection different tests for different properties parametrized by backend argument.
class_docstr_tok: ["Test","class","collection","different","tests","for","different","properties","parametrized","by","backend","argument","."]
docstr: Test that extended stats are computed correctly.
docstr_tok: ["Test","that","extended","stats","are","computed","correctly","."]
code: def test_for_extended_stats(
      self,
      preds,
      target,
      expected_iou_len,
      iou_keys,
      precision_shape,
      recall_shape,
      scores_shape,
      backend,
  ):
      """Test that extended stats are computed correctly."""
      metric = MeanAveragePrecision(
          extended_summary=True, backend=backend
      )
      for p, t in zip(preds, target):
          metric.update(p, t)
      result = metric.compute()
  
      ious = result["ious"]
  
      assert isinstance(ious, dict)
      assert len(ious) == expected_iou_len
      for key in ious:
          assert key in iou_keys
  
      precision = result["precision"]
      assert isinstance(precision, Tensor)
      assert precision.shape == precision_shape
  
      recall = result["recall"]
      assert isinstance(recall, Tensor)
      assert recall.shape == recall_shape
  
      scores = result["scores"]
      assert isinstance(scores, Tensor)
      assert scores.shape == scores_shape
  
imports: import contextlib
  import io
  import json
  from copy import deepcopy
  from functools import partial
  from itertools import product
  import numpy
  import pytest
  import torch
  from lightning_utilities import apply_to_collection
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  from torch import IntTensor, Tensor
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from torchmetrics.utilities.imports import _FASTER_COCO_EVAL_AVAILABLE, _PYCOCOTOOLS_AVAILABLE, _TORCHVISION_GREATER_EQUAL_0_8
  from unittests.detection import _DETECTION_BBOX, _DETECTION_SEGM, _DETECTION_VAL
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 19 for calling the TestMapProperties obj's underlying member method code with example usage: obj.test_for_extended_stats(preds, target, expected_iou_len, iou_keys, precision_shape, recall_shape, scores_shape, backend) without return types