code: def test_scatter_reduce_amax(self, device, dtype):
      for include_self in (True, False):
          self._test_scatter_base(
              torch.Tensor.scatter_reduce_,
              device=device,
              dtype=dtype,
              is_scalar=False,
              reduction="amax",
              unique_indices=False,
              include_self=include_self,
          )
          # simple test for nan/inf propagation
          if dtype.is_floating_point:
              input = torch.zeros(3, device=device, dtype=dtype)
              src = torch.tensor(
                  [
                      1,
                      float("nan"),
                      -float("inf"),
                      -float("inf"),
                      2,
                      float("inf"),
                  ],
                  device=device,
                  dtype=dtype,
              )
              idx = torch.tensor([0, 0, 1, 1, 2, 2], device=device)
              input.scatter_reduce_(
                  0, idx, src, "amax", include_self=include_self
              )
              expected_result = torch.tensor(
                  [float("nan"), -float("inf"), float("inf")],
                  device=device,
                  dtype=dtype,
              )
              if include_self:
                  expected_result[1] = 0
              self.assertEqual(input, expected_result)
  
imports: import random
  import torch
  from torch.testing import make_tensor
  from torch.testing._internal.common_utils import parametrize, run_tests, TestCase, DeterministicGuard
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, onlyCPU, dtypes, dtypesIfCUDA, toleranceOverride, tol
  from torch.testing._internal.common_dtype import get_all_dtypes
label_desc: Use image node_id 14 for calling the TestScatterGather obj's underlying member method code with example usage: obj.test_scatter_reduce_amax(device, dtype) without return types