code: def test_indexing(self, device):
      x = torch.ones(5, 2, dtype=torch.double, device=device)
      y = torch.zeros(5, dtype=torch.double, device=device)
      x[:, [1]] = y.unsqueeze(-1)
      expected = torch.tensor(
          [(1, 0), (1, 0), (1, 0), (1, 0), (1, 0)],
          dtype=torch.double,
          device=device,
      )
      self.assertEqual(x, expected)
  
      # https://github.com/pytorch/pytorch/issues/27824
      tmp = torch.ones(9, 9, dtype=torch.float, device=device)
      mask = torch.ones(10, 10, dtype=torch.uint8, device=device)
      result = tmp + mask[1:, 1:]
      expected = torch.full(
          [9, 9], 2.0, dtype=torch.float, device=device
      ).fill_(2.0)
      self.assertEqual(result, expected)
  
imports: from functools import wraps
  import itertools
  import unittest
  import torch
  from torch.testing._internal.common_utils import TestCase, run_tests, load_tests, make_tensor, TEST_NUMPY, set_default_dtype, torch_to_numpy_dtype_dict, numpy_to_torch_dtype_dict, skipIfTorchDynamo
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, onlyNativeDeviceTypes, dtypes, onlyCPU, expectedFailureMeta, skipMeta
  from torch.testing._internal.common_dtype import all_types_and_complex_and, get_all_math_dtypes, floating_types, get_all_dtypes, float_to_corresponding_complex_type_map
  import numpy
  import operator
label_desc: Use image node_id 30 for calling the TestTypePromotion obj's underlying member method code with example usage: obj.test_indexing(device) without return types