class_docstr: Test class for all metrics.
  
  Class used for efficiently run a lot of parametrized tests in DDP mode. Makes sure that DDP is only setup once and
  that pool of processes are used for all tests. All tests should subclass from this and implement a new method called
  ``test_metric_name`` where the method ``self.run_metric_test`` is called inside.
docstr: Test if a metric can be used with half precision tensors on cpu.
  
  Args:
      preds: torch tensor with predictions
      target: torch tensor with targets
      metric_module: the metric module to test
      metric_functional: the metric functional to test
      metric_args: dict with additional arguments used for class initialization
      dtype: dtype to run test with
      kwargs_update: Additional keyword arguments that will be passed with preds and
          target when running update on the metric.
docstr_tok: ["Test","if","a","metric","can","be","used","with","half","precision","tensors","on","cpu",".","Args",":","preds",":","torch","tensor","with","predictions","target",":","torch","tensor","with","targets","metric_module",":","the","metric","module","to","test","metric_functional",":","the","metric","functional","to","test","metric_args",":","dict","with","additional","arguments","used","for","class","initialization","dtype",":","dtype","to","run","test","with","kwargs_update",":","Additional","keyword","arguments","that","will","be","passed","with","preds","and","target","when","running","update","on","the","metric","."]
code: def run_precision_test_cpu(
      preds: Tensor,
      target: Tensor,
      metric_module: Optional[Metric] = None,
      metric_functional: Optional[Callable] = None,
      metric_args: Optional[dict] = None,
      dtype: torch.dtype = torch.half,
      **kwargs_update: Any,
  ) -> None:
      """Test if a metric can be used with half precision tensors on cpu.
  
      Args:
          preds: torch tensor with predictions
          target: torch tensor with targets
          metric_module: the metric module to test
          metric_functional: the metric functional to test
          metric_args: dict with additional arguments used for class initialization
          dtype: dtype to run test with
          kwargs_update: Additional keyword arguments that will be passed with preds and
              target when running update on the metric.
  
      """
      metric_args = metric_args or {}
      _assert_dtype_support(
          metric_module(**metric_args)
          if metric_module is not None
          else None,
          partial(metric_functional, **metric_args)
          if metric_functional is not None
          else None,
          preds,
          target,
          device="cpu",
          dtype=dtype,
          **kwargs_update,
      )
  
imports: import pickle
  import sys
  from copy import deepcopy
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import pytest
  import torch
  from lightning_utilities import apply_to_collection
  from torch import Tensor, tensor
  from torchmetrics import Metric
  from torchmetrics.utilities.data import _flatten
  from unittests import NUM_PROCESSES
label_desc: Use image node_id 3 for calling the MetricTester obj's underlying member method code with example usage: obj.run_precision_test_cpu(preds, target, metric_module, metric_functional, metric_args, dtype) without return types