2020
09-27
09-27
jupyter notebook tensorflow打印device信息实例
juypternotebook中直接使用log_device_placement=True打印不出来device信息#Createsagraph.withtf.device('/device:CPU:0'):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)#Createsasessionwithlog_device_placementsettoTrue.sess=tf.Session(config=tf.ConfigProto(log_device_pla...
继续阅读 >