分类: 大数据
2017-04-21 15:38:05
import tensorflow as tf x = tf.placeholder("float", None) y = x * 2 with tf.Session() as session: result = session.run(y, feed_dict={x: [1, 2, 3]}) print(result)2. tf.matmul
import tensorflow as tf x = tf.constant(35, name='x') y = tf.Variable(x + 5, name='y') print(y) # y.value 0 model = tf.global_variables_initializer() with tf.Session() as session: session.run(model) print(session.run(y)) # 40