code: def test_functional_rng_wrappers(self, device, dtype):
      torch.manual_seed(123)
      ref1 = torch.rand(10, device=device, dtype=dtype)
      ref2 = torch.rand(10, device=device, dtype=dtype)
  
      torch.manual_seed(123)
      rng_state1, res1 = torch._prims.rng_prims.run_and_save_rng_state(
          torch.rand, 10, device=device, dtype=dtype
      )
      rng_state2, res2 = torch._prims.rng_prims.run_and_save_rng_state(
          torch.rand, 10, device=device, dtype=dtype
      )
  
      res3 = torch._prims.rng_prims.run_with_rng_state(
          rng_state1, torch.rand, 10, device=device, dtype=dtype
      )
      res4 = torch._prims.rng_prims.run_with_rng_state(
          rng_state2, torch.rand, 10, device=device, dtype=dtype
      )
  
      self.assertEqual(ref1, res1)
      self.assertEqual(ref2, res2)
      self.assertEqual(ref1, res3)
      self.assertEqual(ref2, res4)
  
imports: from functools import partial
  from itertools import product
  import unittest
  import torch
  from torch.testing import make_tensor
  from torch.testing._internal.common_utils import parametrize, run_tests, TestCase, TEST_SCIPY, set_default_dtype
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, onlyCUDA, dtypes, OpDTypes
  from torch.testing._internal.common_methods_invocations import op_db
  from torch.testing._internal.common_device_type import ops
  from torch.testing._internal.logging_tensor import LoggingTensor, capture_logs, log_input
  import torch._prims
  from torch._prims_common import CUDARngStateHelper
  from torch._prims.executor import make_traced
  import torch._refs
label_desc: Use image node_id 10 for calling the TestPrims obj's underlying member method code with example usage: obj.test_functional_rng_wrappers(device, dtype) without return types