MCPcopy Index your code
hub / github.com/tensorflow/tensorboard / _run_serve_subcommand

Method _run_serve_subcommand

tensorboard/program.py:280–303  ·  view source on GitHub ↗
(self, flags)

Source from the content-addressed store, hash-verified

278 return runner(self.flags) or 0
279
280 def _run_serve_subcommand(self, flags):
281 # TODO(#2801): Make `--version` a flag on only the base parser, not `serve`.
282 if flags.version_tb:
283 print(version.VERSION)
284 return 0
285 if flags.inspect:
286 # TODO(@wchargin): Convert `inspect` to a normal subcommand?
287 logger.info(
288 "Not bringing up TensorBoard, but inspecting event files."
289 )
290 event_file = os.path.expanduser(flags.event_file)
291 efi.inspect(flags.logdir, event_file, flags.tag)
292 return 0
293 try:
294 server = self._make_server()
295 server.print_serving_message()
296 self._register_info(server)
297 server.serve_forever()
298 return 0
299 except TensorBoardServerException as e:
300 logger.error(e.msg)
301 sys.stderr.write("ERROR: %s\n" % e.msg)
302 sys.stderr.flush()
303 return -1
304
305 def launch(self):
306 """Python API for launching TensorBoard.

Callers

nothing calls this directly

Calls 6

_make_serverMethod · 0.95
_register_infoMethod · 0.95
serve_foreverMethod · 0.80
flushMethod · 0.65
print_serving_messageMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected