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

Function OpenUrl

tensorflow/compiler/xla/tools/interactive_graphviz.cc:400–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400void OpenUrl(const Options& opts, absl::string_view url) {
401 std::cout << url << std::endl;
402
403 // If it is a url, try to open it up in the user's browser too.
404 if (absl::StartsWithIgnoreCase(url, "http://") ||
405 absl::StartsWithIgnoreCase(url, "https://") ||
406 absl::StartsWithIgnoreCase(url, "file://")) {
407 const char* browser_bin = opts.browser.empty() ? "/usr/bin/sensible-browser"
408 : opts.browser.c_str();
409 tensorflow::SubProcess p;
410 p.SetProgram(browser_bin, {browser_bin, string(url)});
411 p.Start();
412 } else {
413 std::cerr << "\nExpected a URL, but got strange graph result (dumped "
414 "above). If this isn't what you expected, maybe file a bug?"
415 << std::endl;
416 }
417}
418
419// Renders a graph by calling `renderer`, and then tries to open it.
420//

Callers 1

RenderAndDisplayGraphFunction · 0.85

Calls 4

c_strMethod · 0.80
SetProgramMethod · 0.80
emptyMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected