tf.get_default_graph()
功能:获取当前默认计算图。
import tensorflow as tf
a = tf.constant(1)
b = tf.constant(2)
c = a+b
print(c.graph)
print(tf.get_default_graph())
--------------------------------------------------------------
<tensorflow.python.framework.ops.Graph object at 0x00000000025A8BE0>
<tensorflow.python.framework.ops.Graph object at 0x00000000025A8BE0>