Created
May 22, 2020 22:41
-
-
Save turtlesoupy/d6e00b5bea51b82173b67cf57b26e47f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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