code: def chain_passes(*passes: PassFunc) -> PassFunc:
      def parent_pass(
          module: torch.fx.GraphModule, input: Any
      ) -> torch.fx.GraphModule:
          for pass_ in passes:
              if isinstance(module, torch.fx.GraphModule):
                  ShapeProp(module).propagate(*input)
              module = pass_(module)
          return module
  
      return parent_pass
  
file_path: pytorch/test/inductor/test_fx_fusion.py
imports: from typing import Any, Callable
  import torch
  from torch._inductor.fx_passes.pre_grad import linear_permute_fusion, linear_transpose, permute_linear_fusion, permute_matmul_fusion, sink_cat_after_pointwise, transpose_linear, transpose_matmul
  from torch.fx.passes.shape_prop import ShapeProp
  from torch.testing._internal.common_utils import run_tests, TestCase
label_desc: Use image node_id 1 for calling a global function with example usage: chain_passes() and returns: parent_pass, module