code: def time_fn(fn, equation, *operands, **kwargs):
      iters = kwargs.pop("iters")
      _CACHE.clear()  # Avoid memory leaks.
      fn(equation, *operands, **kwargs)
  
      time_start = timeit.default_timer()
      for i in range(iters):
          fn(equation, *operands, **kwargs)
      time_end = timeit.default_timer()
  
      return (time_end - time_start) / iters
  
file_path: pyro/examples/einsum.py
imports: import argparse
  import timeit
  import torch
  from torch.autograd import grad
  from pyro.ops.contract import einsum
  from pyro.ops.einsum.adjoint import require_backward
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 8 for calling a global function with example usage: time_fn(fn, equation) and returns: unknown