code: def test_multiplication_numpy_scalar(self, device) -> None:
      for np_dtype in [
          np.float32,
          np.float64,
          np.int32,
          np.int64,
          np.int16,
          np.uint8,
      ]:
          for t_dtype in [torch.float, torch.double]:
              # mypy raises an error when np.floatXY(2.0) is called
              # even though this is valid code
              np_sc = np_dtype(2.0)  # type: ignore[abstract, arg-type]
              t = torch.ones(2, requires_grad=True, dtype=t_dtype)
              r1 = t * np_sc
              self.assertIsInstance(r1, torch.Tensor)
              self.assertTrue(r1.dtype == t_dtype)
              self.assertTrue(r1.requires_grad)
              r2 = np_sc * t
              self.assertIsInstance(r2, torch.Tensor)
              self.assertTrue(r2.dtype == t_dtype)
              self.assertTrue(r2.requires_grad)
  
imports: import torch
  import numpy
  from itertools import product
  from torch.testing._internal.common_utils import skipIfTorchDynamo, TestCase, run_tests
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, onlyCPU, dtypes, skipMeta
  from torch.testing._internal.common_dtype import all_types_and_complex_and
label_desc: Use image node_id 13 for calling the TestNumPyInterop obj's underlying member method code with example usage: obj.test_multiplication_numpy_scalar(device) without return types