code: def test_min_cut_partitioner(self, dtype, device):
      # Checks that the calling convention is maintained
      shape = (16, 16)
  
      def fn(x):
          a = torch.rand_like(x) * x
          a = torch.rand_like(x) * a
          a = torch.sin(a)
          a = torch.sin(a)
          a = torch.sin(a)
          return a
  
      x = torch.rand(
          *shape, device=device, dtype=dtype, requires_grad=True
      )
  
      x_clone = x.clone().detach().requires_grad_(True)
  
      torch.cuda.manual_seed(123)
      ref = fn(x)
      ref.sum().backward()
  
      torch.cuda.manual_seed(123)
      fwd_compiler = functools.partial(count_philox_rand, freq=2)
      bwd_compiler = functools.partial(count_philox_rand, freq=0)
      aot_custom = aot_function(
          fn,
          fwd_compiler,
          bwd_compiler,
          partition_fn=min_cut_rematerialization_partition,
      )
      # aot_custom = aot_function(fn, fwd_compiler, bwd_compiler)
      res = aot_custom(x_clone)
      res.sum().backward()
  
      self.assertEqual(ref, res)
      self.assertEqual(x.grad, x_clone.grad)
  
imports: import sys
  import unittest
  import torch
  from torch.testing._internal.common_utils import TestCase, run_tests
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, dtypes
  from functorch.compile import aot_function, nop, min_cut_rematerialization_partition
  from unittest.mock import patch
  import functools
  import torch.utils.checkpoint
  from torch.testing._internal.common_utils import IS_CI, IS_WINDOWS
label_desc: Use image node_id 8 for calling the TestFunctionalizationRngOps obj's underlying member method code with example usage: obj.test_min_cut_partitioner(dtype, device) and returns: a