with tf.Session() as sess: with tf.device("/gpu:0"): ................. a是一个tensor,如果要输出a的值,则print(a.eval())