code: def test_float_promotion(self, device):
      def test_promotion(dtype_float, dtype_double):
          a = torch.ones([4, 4, 4], dtype=dtype_float, device=device)
          b = torch.ones([4, 4, 4], dtype=dtype_double, device=device)
          c = a + b
          self.assertEqual(c, b + b)
          self.assertEqual(c.dtype, dtype_double)
          c = b + a
          self.assertEqual(c, b + b)
          self.assertEqual(c.dtype, dtype_double)
  
      test_promotion(torch.float, torch.double)
  
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 4 for calling the TestTypePromotion obj's underlying member method code with example usage: obj.test_float_promotion(device) without return types