MCPcopy
hub / github.com/tinygrad/tinygrad / run_cli

Function run_cli

test/null/test_viz.py:917–922  ·  view source on GitHub ↗
(*cli_args)

Source from the content-addressed store, hash-verified

915
916# launch viz cli without subprocess
917def run_cli(*cli_args) -> list[dict]:
918 from tinygrad.viz.cli import main, get_arg_parser
919 args = get_arg_parser().parse_args(cli_args+("--json",))
920 with contextlib.redirect_stdout(buf:=io.StringIO()):
921 main(args)
922 return [json.loads(line) for line in buf.getvalue().strip().splitlines()]
923
924@contextlib.contextmanager
925def write_files(viz) -> list[str]:

Callers 6

test_sqtt_cliMethod · 0.90
test_aggregateMethod · 0.85
test_flopsMethod · 0.85
test_dedupMethod · 0.85
test_call_graphMethod · 0.85

Calls 2

get_arg_parserFunction · 0.90
mainFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…