小编Enc*_*eTS的帖子

在TensorFlow中,变量名称中":0"的含义是什么?

import tensorflow as tf
with tf.device('/gpu:0'):
    foo = tf.Variable(1, name='foo')
    assert foo.name == "foo:0"
with tf.device('/gpu:1'):
    bar = tf.Variable(1, name='bar')
    assert bar.name == "bar:0"
Run Code Online (Sandbox Code Playgroud)

上面的代码返回true.我with tf.device在这里用来说明":0"并不意味着变量位于特定的设备上.那么变量名称中":0"的含义是什么(本例中为foo和bar) )?

python tensorflow

20
推荐指数
1
解决办法
4620
查看次数

标签 统计

python ×1

tensorflow ×1