Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save turtlesoupy/d6e00b5bea51b82173b67cf57b26e47f to your computer and use it in GitHub Desktop.

Select an option

Save turtlesoupy/d6e00b5bea51b82173b67cf57b26e47f to your computer and use it in GitHub Desktop.
def skimpy_dense(n, n_ops):
base_np = np.ones(n)
multiplier_np = np.random.randint(2 ** 3 - 1, size=n)
base_skimpy = skimpy.from_numpy(base_np)
multiplier_skimpy = skimpy.from_numpy(multiplier_np)
for i in range(n_ops):
base_skimpy = base_skimpy * multiplier_skimpy
t = Timer()
with t:
_ = base_skimpy.eval()
return t.duration_ns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment