code: def test_half_precision_top_k_cpu_raises_error():
      """Test that half precision topk raises error on cpu.
  
      If this begins to fail, it means newer Pytorch versions support this and we can drop internal support.
  
      """
      x = torch.randn(100, 10, dtype=torch.half)
      with pytest.raises(
          RuntimeError, match="\"topk_cpu\" not implemented for 'Half'"
      ):
          torch.topk(x, k=3, dim=1)
  
imports: import sys
  import numpy
  import pytest
  import torch
  from torch import tensor
  from torchmetrics.regression import MeanSquaredError, PearsonCorrCoef
  from torchmetrics.utilities import check_forward_full_state_property, rank_zero_debug, rank_zero_info, rank_zero_warn
  from torchmetrics.utilities.checks import _allclose_recursive
  from torchmetrics.utilities.data import _bincount, _cumsum, _flatten, _flatten_dict, select_topk, to_categorical, to_onehot
  from torchmetrics.utilities.distributed import class_reduce, reduce
  from torchmetrics.utilities.exceptions import TorchMetricsUserWarning
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_13
label_desc: Use image node_id 15 for calling a global function with example usage: test_half_precision_top_k_cpu_raises_error() without return types