Benchmarking¶
AlphAI provides a very pythonic and simple approach to time and benchmark your code and callables (functions).
Using these tools do not require authentication.
Timing¶
Let's instantiate the AlphAI
object and create a python function to time and benchmark:
Now let's see how long it takes to run this function. It should take around 0.055 seconds; simple!
Benchmark¶
Our benchmark()
is currently really a timer, but evaluation by comparison is a simple step. Also note that benchmark
works with key word arguments as well.
Key Word Arguments¶
Example with PyTorch¶
Why don't we try this on a forward pass of a PyTorch model!