code: def rewrite_batched_nms_with_max_out_size(mod):
      """Rewrite the input graph to detect slicing after batched nms and
      use the slicing size as the parameter max_out_size in NMS.
      """
      mod["main"] = rewrite(PostNMSTopKRewrite(), 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 8 for calling a global function with example usage: rewrite_batched_nms_with_max_out_size(mod) and returns: mod