MCPcopy Create free account
hub / github.com/pytorch/tutorials / group_by_file

Function group_by_file

recipes_source/recipes/timer_quick_start.py:225–233  ·  view source on GitHub ↗
(fn_name: str)

Source from the content-addressed store, hash-verified

223import re
224
225def group_by_file(fn_name: str):
226 if fn_name.startswith("???"):
227 fn_dir, fn_file = fn_name.split(":")[:2]
228 else:
229 fn_dir, fn_file = os.path.split(fn_name.split(":")[0])
230 fn_dir = re.sub("^.*build/../", "", fn_dir)
231 fn_dir = re.sub("^.*torch/", "torch/", fn_dir)
232
233 return f"{fn_dir:<15} {fn_file}"
234
235print(inclusive_stats.transform(group_by_file)[:10])
236

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected