code: def benchmark_fn(f, *args, **kwargs):
      t0 = benchmark.Timer(
          stmt="f(*args, **kwargs)",
          globals={"args": args, "kwargs": kwargs, "f": f},
          num_threads=torch.get_num_threads(),
      )
      return f"{(t0.blocked_autorange().mean):.3f}"
  
file_path: diffusion-fast/utils/benchmarking_utils.py
imports: import argparse
  import copy
  import csv
  import gc
  from typing import Dict, List, Union
  import torch
  import torch.utils.benchmark
label_desc: Use image node_id 4 for calling a global function with example usage: benchmark_fn(f) and returns: t0