code: def rewrite_nms_to_batched_nms(mod):
      """Rewrite the input graph to replace non maximum surpression
      in torchvision that does not take class id into account with the one
      that avoids IOU tests between different classes.
      """
      mod["main"] = rewrite(MulticlassNMSRewrite(), mod["main"])
      return mod
  
imports: from ..None import expr
  from ..None import op
  from ..dataflow_pattern import wildcard, is_constant, is_op, rewrite, is_tuple, is_tuple_get_item, is_if, DFPatternCallback
label_desc: Use image node_id 7 for calling a global function with example usage: rewrite_nms_to_batched_nms(mod) and returns: mod