how the tensorflow call the device? And how the tesorflow assign the task to the device for automatically? Are there interface source code in tensorflow? But I can't find the source code in details.
just like :
with tf.device('/gpu:2'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
why when we run the with tf.device('/gpu:2'):,the ops(a,b,c) can assign to the gpu:2 for automatically,how can I find the detailed descriptions in the source code of tensorflow?
Thanks in advance.