【发布时间】:2016-10-31 17:44:04
【问题描述】:
我们可以在tensorflow GraphDef中看到Send节点和Receive节点,还是使用python API?
我试试下面的代码
import tensorflow as tf
with tf.device("/gpu:0"):
x = tf.constant(1.0)
with tf.device("/gpu:1"):
y = tf.constant(2.0)
with tf.device("/cpu:0"):
sum = tf.add(x, y)
graph_def = tf.get_default_graph().as_graph_def()
print(graph_def)
但graph_def 中没有发送/接收节点。图表中是否添加了任何发送/接收节点以将x 和y 传输到cpu?
【问题讨论】:
标签: python tensorflow