class_docstr: Test class for `BinaryCohenKappa` metric.
class_docstr_tok: ["Test","class","for","`","BinaryCohenKappa","`","metric","."]
docstr: Test dtype support of the metric on CPU.
docstr_tok: ["Test","dtype","support","of","the","metric","on","CPU","."]
code: def test_binary_cohen_kappa_dtypes_cpu(self, inputs, dtype):
      """Test dtype support of the metric on CPU."""
      preds, target = inputs
  
      if (preds < 0).any() and dtype == torch.half:
          pytest.xfail(
              reason="torch.sigmoid in metric does not support cpu + half precision"
          )
      self.run_precision_test_cpu(
          preds=preds,
          target=target,
          metric_module=BinaryCohenKappa,
          metric_functional=binary_cohen_kappa,
          metric_args={"threshold": THRESHOLD},
          dtype=dtype,
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from sklearn.metrics import cohen_kappa_score
  from torchmetrics.classification.cohen_kappa import BinaryCohenKappa, CohenKappa, MulticlassCohenKappa
  from torchmetrics.functional.classification.cohen_kappa import binary_cohen_kappa, multiclass_cohen_kappa
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES, THRESHOLD
  from unittests.classification.inputs import _binary_cases, _multiclass_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
label_desc: Use image node_id 4 for calling the TestBinaryCohenKappa obj's underlying member method code with example usage: obj.test_binary_cohen_kappa_dtypes_cpu(inputs, dtype) without return types