code: def test_scatter_add_mult_index_base(self, device, dtype):
      for deterministic in [False, True]:
          with DeterministicGuard(deterministic):
              m, n = 30, 40
              idx = torch.zeros(m, n, device=device, dtype=torch.long)
              src = torch.ones(m, n, device=device, dtype=dtype)
              res0 = torch.zeros(
                  m, n, device=device, dtype=dtype
              ).scatter_add_(0, idx, src)
              res1 = torch.zeros(
                  m, n, device=device, dtype=dtype
              ).scatter_add_(1, idx, src)
  
              self.assertEqual(
                  res0[0, :],
                  m * torch.ones(n, device=device, dtype=dtype),
                  atol=0,
                  rtol=0,
              )
              self.assertEqual(
                  res1[:, 0],
                  n * torch.ones(m, device=device, dtype=dtype),
                  atol=0,
                  rtol=0,
              )
  
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 10 for calling the TestScatterGather obj's underlying member method code with example usage: obj.test_scatter_add_mult_index_base(device, dtype) without return types