class_docstr: Test class for `BinaryPrecisionAtFixedRecall` metric.
class_docstr_tok: ["Test","class","for","`","BinaryPrecisionAtFixedRecall","`","metric","."]
docstr: Test dtype support of the metric on CPU.
code: def test_binary_precision_at_fixed_recall_dtype_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=BinaryPrecisionAtFixedRecall,
          metric_functional=binary_precision_at_fixed_recall,
          metric_args={"min_recall": 0.5, "thresholds": None},
          dtype=dtype,
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from scipy.special import softmax
  from sklearn.metrics import precision_recall_curve
  from torchmetrics.classification.precision_fixed_recall import BinaryPrecisionAtFixedRecall, MulticlassPrecisionAtFixedRecall, MultilabelPrecisionAtFixedRecall, PrecisionAtFixedRecall
  from torchmetrics.functional.classification.precision_fixed_recall import binary_precision_at_fixed_recall, multiclass_precision_at_fixed_recall, multilabel_precision_at_fixed_recall
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES
  from unittests.classification.inputs import _binary_cases, _multiclass_cases, _multilabel_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 TestBinaryPrecisionAtFixedRecall obj's underlying member method code with example usage: obj.test_binary_precision_at_fixed_recall_dtype_cpu(inputs, dtype) without return types