code: def checkPatterns(self, graph, patterns):
      fusion_groups = self.findFusionGroups(graph)
      assert len(fusion_groups) == len(
          patterns
      ), "length of subgraphs not equal to length of given patterns"
  
      for i in range(len(fusion_groups)):
          for pattern in patterns[i]:
              self.assertGraphContains(fusion_groups[i], pattern)
  
imports: import sys
  import torch
  import unittest
  import itertools
  import torch.nn
  from functools import wraps
  from concurrent import futures
  import torch.nn.functional
  import torch.fx.experimental.optimization
  from torch.testing._internal.jit_utils import JitTestCase
  from torch.testing._internal.common_utils import run_tests, TEST_SCIPY, IS_WINDOWS, IS_MACOS
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, onlyCPU, dtypes
label_desc: Use image node_id 6 for calling the JitLlgaTestCase obj's underlying member method code with example usage: obj.checkPatterns(graph, patterns) without return types