import tensorflow as tf #查看tensorflow版本 print(tf.__version__) print('GPU', tf.test.is_gpu_available()) a = tf.constant(2.0) b = tf.constant(4.0) print(a + b)
成功如图:
import tensorflow as tf tf.test.is_gpu_available()