code: def replace_random_passes(gm: torch.fx.GraphModule):
      """Modify the given FX graph to use backend-native random ops"""
      if config.fallback_random:
          return 0
  
      count = patterns.apply(gm)
      count += fuse_seed_creation_pass(gm.graph)
  
      return count
  
file_path: pytorch/torch/_inductor/fx_passes/replace_random.py
imports: import collections
  import logging
  import torch
  from torch.fx.passes.shape_prop import _extract_tensor_metadata
  from ..None import config, inductor_prims
  from ..pattern_matcher import CallFunctionVarArgs, Match, PatternMatcherPass, register_graph_pattern
  from ..virtualized import V
label_desc: Use image node_id 1 for calling a global function with example usage: replace_random_passes(gm) and returns: count, int