code: def test_random_cpu(self):
      x1 = torch.randn(20, 100, requires_grad=True)
      x2 = x1.clone()
  
      net1 = RandomModel()
      net2 = deepcopy(net1)
  
      cpu_rng_state = torch.get_rng_state()
      net1(x1).sum().backward()
      torch.set_rng_state(cpu_rng_state)
      checkpoint(net2)(x2).sum().backward()
  
      for p1, p2 in zip(net1.parameters(), net2.parameters()):
          self.assertEqual(p1.grad, p2.grad)
  
imports: import unittest
  from collections import deque, OrderedDict
  from contextlib import ContextDecorator
  from copy import deepcopy
  from typing import Tuple
  import torch
  import torch.nn
  from torch.distributed._composable import checkpoint
  from torch.testing._internal.common_cuda import TEST_CUDA
  from torch.testing._internal.common_utils import run_tests, TestCase
label_desc: Use image node_id 5 for calling the TestCheckpoint obj's underlying member method code with example usage: obj.test_random_cpu() without return types