code: def time_func(matrix, op, duration=5.0, warmup=1.0):
      t = time.time()
      while (time.time() - t) < warmup:
          op(matrix)
      torch.cuda.synchronize()
      count = 0
      t = time.time()
      while (time.time() - t) < duration:
          op(matrix)
          count += 1
          torch.cuda.synchronize()
      return (time.time() - t) / count
  
file_path: pytorch_sparse/benchmark/ptr2ind.py
imports: import os
  import wget
  import time
  import errno
  import argparse
  import os.path
  import torch
  from scipy.io import loadmat
label_desc: Use image node_id 2 for calling a global function with example usage: time_func(matrix, op, duration, warmup) and returns: unknown