class_docstr: Test class for `MeanError` metric.
class_docstr_tok: ["Test","class","for","`","MeanError","`","metric","."]
docstr: Test dtype support of the metric on CPU.
docstr_tok: ["Test","dtype","support","of","the","metric","on","CPU","."]
code: def test_mean_error_half_cpu(
      self,
      preds,
      target,
      ref_metric,
      metric_class,
      metric_functional,
      sk_fn,
      metric_args,
  ):
      """Test dtype support of the metric on CPU."""
      if metric_class == MeanSquaredLogError:
          # MeanSquaredLogError half + cpu does not work due to missing support in torch.log
          pytest.xfail(
              "MeanSquaredLogError metric does not support cpu + half precision"
          )
  
      if metric_class == MeanAbsolutePercentageError:
          # MeanSquaredPercentageError half + cpu does not work due to missing support in torch.log
          pytest.xfail(
              "MeanSquaredPercentageError metric does not support cpu + half precision"
          )
  
      if metric_class == SymmetricMeanAbsolutePercentageError:
          # MeanSquaredPercentageError half + cpu does not work due to missing support in torch.log
          pytest.xfail(
              "SymmetricMeanAbsolutePercentageError metric does not support cpu + half precision"
          )
  
      if metric_class == WeightedMeanAbsolutePercentageError:
          # WeightedMeanAbsolutePercentageError half + cpu does not work due to missing support in torch.clamp
          pytest.xfail(
              "WeightedMeanAbsolutePercentageError metric does not support cpu + half precision"
          )
  
      self.run_precision_test_cpu(
          preds, target, metric_class, metric_functional
      )
  
imports: import math
  from functools import partial
  from typing import Optional
  import numpy
  import pytest
  import torch
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_absolute_percentage_error
  from sklearn.metrics import mean_squared_error
  from sklearn.metrics import mean_squared_log_error
  from sklearn.metrics._regression import _check_reg_targets
  from sklearn.utils import check_consistent_length
  from torchmetrics.functional import mean_absolute_error, mean_absolute_percentage_error, mean_squared_error, mean_squared_log_error, weighted_mean_absolute_percentage_error
  from torchmetrics.functional.regression.symmetric_mape import symmetric_mean_absolute_percentage_error
  from torchmetrics.regression import MeanAbsoluteError, MeanAbsolutePercentageError, MeanSquaredError, MeanSquaredLogError, WeightedMeanAbsolutePercentageError
  from torchmetrics.regression.symmetric_mape import SymmetricMeanAbsolutePercentageError
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 4 for calling the TestMeanError obj's underlying member method code with example usage: obj.test_mean_error_half_cpu(preds, target, ref_metric, metric_class, metric_functional, sk_fn, metric_args) without return types