I’m currently tackling my first issue in PyTorch by refactoring two functions. I noticed that there were two functions that appear to do the same thing but I’m guessing that time-wise they don’t operate the same. How would one run tests for benchmarking?
Here’s a relevant screenshot of what I wanna achieve:
The performance test part to me is a self wrote script.
If you are under python. You can simply use timeit with string format to get the same output layout as above.
Thanks for taking the time to answer my question!
I just want to check if this is valid:
- Time the original function.
- Make modifications to code.
- Rebuild (
python setup.py develop --cmake along with some flags like
- Test (
python run_test.py for the specific module) to ensure correctness.
- Time the function again (now that it’s been changed).
That make sense!.