/usr/local/lib64/python3.6/site-packages/torch/utils/benchmark/examples
NameSizeModeActions
__pycache__/-0755rm
blas_compare.py76240644editdlrm
blas_compare_setup.py72330644editdlrm
compare.py28960644editdlrm
end_to_end.py146530644editdlrm
fuzzer.py26220644editdlrm
op_benchmark.py41760644editdlrm
simple_timeit.py5330644editdlrm
spectral_ops_fuzz_test.py46990644editdlrm
__init__.py00644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/utils/benchmark/examples/simple_timeit.py (533B)
"""Trivial use of Timer API: $ python -m examples.simple_timeit """ import torch import torch.utils.benchmark as benchmark_utils def main(): timer = benchmark_utils.Timer( stmt="x + y", globals={"x": torch.ones((4, 8)), "y": torch.ones((1, 8))}, label="Broadcasting add (4x8)", ) for i in range(3): print(f"Run: {i}\n{'-' * 40}") print(f"timeit:\n{timer.timeit(10000)}\n") print(f"autorange:\n{timer.blocked_autorange()}\n\n") if __name__ == "__main__": main()