MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / create_analyzer_cli

Function create_analyzer_cli

tensorflow/python/debug/cli/analyzer_cli_test.py:516–575  ·  view source on GitHub ↗

Create an analyzer CLI. Args: dump: A `DebugDumpDir` object to base the analyzer CLI on. Returns: 1) A `DebugAnalyzer` object created based on `dump`. 2) A `CommandHandlerRegistry` that is based on the `DebugAnalyzer` object and has the common tfdbg commands, e.g., lt, ni, l

(dump)

Source from the content-addressed store, hash-verified

514
515
516def create_analyzer_cli(dump):
517 """Create an analyzer CLI.
518
519 Args:
520 dump: A `DebugDumpDir` object to base the analyzer CLI on.
521
522 Returns:
523 1) A `DebugAnalyzer` object created based on `dump`.
524 2) A `CommandHandlerRegistry` that is based on the `DebugAnalyzer` object
525 and has the common tfdbg commands, e.g., lt, ni, li, lo, registered.
526 """
527 # Construct the analyzer.
528 analyzer = analyzer_cli.DebugAnalyzer(dump, _cli_config_from_temp_file())
529
530 # Construct the handler registry.
531 registry = debugger_cli_common.CommandHandlerRegistry()
532
533 # Register command handlers.
534 registry.register_command_handler(
535 "list_tensors",
536 analyzer.list_tensors,
537 analyzer.get_help("list_tensors"),
538 prefix_aliases=["lt"])
539 registry.register_command_handler(
540 "node_info",
541 analyzer.node_info,
542 analyzer.get_help("node_info"),
543 prefix_aliases=["ni"])
544 registry.register_command_handler(
545 "list_inputs",
546 analyzer.list_inputs,
547 analyzer.get_help("list_inputs"),
548 prefix_aliases=["li"])
549 registry.register_command_handler(
550 "list_outputs",
551 analyzer.list_outputs,
552 analyzer.get_help("list_outputs"),
553 prefix_aliases=["lo"])
554 registry.register_command_handler(
555 "print_tensor",
556 analyzer.print_tensor,
557 analyzer.get_help("print_tensor"),
558 prefix_aliases=["pt"])
559 registry.register_command_handler(
560 "print_source",
561 analyzer.print_source,
562 analyzer.get_help("print_source"),
563 prefix_aliases=["ps"])
564 registry.register_command_handler(
565 "list_source",
566 analyzer.list_source,
567 analyzer.get_help("list_source"),
568 prefix_aliases=["ls"])
569 registry.register_command_handler(
570 "eval",
571 analyzer.evaluate_expression,
572 analyzer.get_help("eval"),
573 prefix_aliases=["ev"])

Callers 5

setUpClassMethod · 0.85
setUpClassMethod · 0.85
setUpClassMethod · 0.85
setUpClassMethod · 0.85

Calls 3

get_helpMethod · 0.95

Tested by

no test coverage detected