MCPcopy Index your code
hub / github.com/pytorch/tutorials / timer

Function timer

intermediate_source/pinmem_nonblock.py:262–270  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

260
261
262def timer(cmd):
263 median = (
264 Timer(cmd, globals=globals())
265 .adaptive_autorange(min_run_time=1.0, max_run_time=20.0)
266 .median
267 * 1000
268 )
269 print(f"{cmd}: {median: 4.4f} ms")
270 return median
271
272
273# A tensor in pageable memory

Callers 1

pinmem_nonblock.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected