MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / write_graph

Function write_graph

tensorboard/plugins/graph/graphs_demo.py:48–65  ·  view source on GitHub ↗

Demonstrate basic graph writing.

()

Source from the content-addressed store, hash-verified

46
47
48def write_graph():
49 """Demonstrate basic graph writing."""
50 logdir = os.path.join(LOGDIR, "write_graph")
51
52 @tf.function
53 def f():
54 x = tf.constant(2)
55 y = tf.constant(3)
56 return x**y
57
58 with tf.summary.create_file_writer(logdir).as_default():
59 if hasattr(tf.summary, "graph"):
60 # Emit a simple graph.
61 tf.summary.graph(f.get_concrete_function().graph)
62 else:
63 print(
64 "Could not find tf.summary.graph(); use TF 2.5.0+ to run full demo"
65 )
66
67
68def keras():

Callers 1

mainFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…