class_docstr: Test map metric on the reference coco data.
class_docstr_tok: ["Test","map","metric","on","the","reference","coco","data","."]
docstr: Test modular implementation for correctness with classwise=True.
  
  Needs bigger atol to be stable.
docstr_tok: ["Test","modular","implementation","for","correctness","with","classwise=True",".","Needs","bigger","atol","to","be","stable","."]
code: def test_map_classwise(self, iou_type, ddp, backend):
      """Test modular implementation for correctness with classwise=True.
  
      Needs bigger atol to be stable.
  
      """
      _skip_if_faster_coco_eval_missing(backend)
      preds, target = (
          _coco_bbox_input if iou_type == "bbox" else _coco_segm_input
      )
      self.run_class_metric_test(
          ddp=ddp,
          preds=preds,
          target=target,
          metric_class=MeanAveragePrecision,
          reference_metric=partial(
              _compare_against_coco_fn,
              iou_type=iou_type,
              class_metrics=True,
          ),
          metric_args={
              "box_format": "xywh",
              "iou_type": iou_type,
              "class_metrics": True,
              "backend": backend,
          },
          check_batch=False,
          atol=1e-1,
      )
  
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 2 for calling the TestMAPUsingCOCOReference obj's underlying member method code with example usage: obj.test_map_classwise(iou_type, ddp, backend) without return types