class_docstr: Test class for `SpectralAngleMapper` metric.
class_docstr_tok: ["Test","class","for","`","SpectralAngleMapper","`","metric","."]
docstr: Test dtype support of the metric on GPU.
docstr_tok: ["Test","dtype","support","of","the","metric","on","GPU","."]
code: def test_sam_half_gpu(self, reduction, preds, target):
      """Test dtype support of the metric on GPU."""
      self.run_precision_test_gpu(
          preds, target, SpectralAngleMapper, spectral_angle_mapper
      )
  
imports: from functools import partial
  import pytest
  import torch
  from torch import Tensor
  from torch.nn import functional
  from torchmetrics.functional.image.sam import spectral_angle_mapper
  from torchmetrics.image.sam import SpectralAngleMapper
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  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 TestSpectralAngleMapper obj's underlying member method code with example usage: obj.test_sam_half_gpu(reduction, preds, target) without return types