tensorflow-计算图
<tensorflow.python.framework.ops.Graph object at 0xb1cd345c0>
<tensorflow.python.framework.ops.Graph object at 0xb1cd345c0>
<tensorflow.python.framework.ops.Graph object at 0x10d1f6160>
從輸出可以看出
print(c1.graph)
print(g)
輸出為同一個計算圖,
而 print(c.graph)為另一個計算圖
<tensorflow.python.framework.ops.Graph object at 0xb19ce09b0>
<tensorflow.python.framework.ops.Graph object at 0xb19ce0e48>
Const:0
重置計算圖以及獲得tensor
<tensorflow.python.framework.ops.Graph object at 0x7f8aaa8e5160>
<tensorflow.python.framework.ops.Graph object at 0x7f8a90a9a710>
Const:0
Tensor(“Const:0”, shape=(), dtype=float32)
exampleop:0 Tensor(“exampleop:0”, shape=(1, 1), dtype=float32)
Tensor(“exampleop:0”, shape=(1, 1), dtype=float32)
exampleop
name: “exampleop”
op: “MatMul”
input: “Const”
input: “Const_1”
attr {
key: “T”
value {
type: DT_FLOAT
}
}
attr {
key: “transpose_a”
value {
b: false
}
}
attr {
key: “transpose_b”
value {
b: false
}
}
2018-12-25 17:26:56.179157: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
[[7.]]
Tensor(“exampleop:0”, shape=(1, 1), dtype=float32)
[<tf.Operation ‘Const’ type=Const>]
Tensor(“Const:0”, shape=(), dtype=float32)
[
總結
以上是生活随笔為你收集整理的tensorflow-计算图的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tensorflow随笔-tf.Read
- 下一篇: Linux nohup实现后台运行程序及