tensorflow 2.3.1
注意:新版本和旧版本的一些区别
import tensorflow as tf tf.compat.v1.disable_eager_execution() v_1 = tf.constant([1,2,3,4]) v_2 = tf.constant([2,1,5,3]) v_add = tf.add(v_1,v_2) with tf.compat.v1.Session() as sees: print(sees.run(v_add))
注意:新版本和旧版本的一些区别
import tensorflow as tf tf.compat.v1.disable_eager_execution() v_1 = tf.constant([1,2,3,4]) v_2 = tf.constant([2,1,5,3]) v_add = tf.add(v_1,v_2) with tf.compat.v1.Session() as sees: print(sees.run(v_add))