tensorflow 一些使用技巧
作者:互联网
1. 多个变量在session中run:
import tensorflow as tf
x = [[1,2,3],
[1,2,3]]
xx = tf.cast(x,tf.float32)
mean_all = tf.reduce_mean(xx, keep_dims=False)
mean_0 = tf.reduce_mean(xx, axis=0, keep_dims=False)
mean_1 = tf.reduce_mean(xx, axis=1, keep_dims=False)
with tf.Session() as sess:
m_a,m_0,m_1 = sess.run([mean_all, mean_0, mean_1]) #多个变量在session中run
标签:False,技巧,dims,xx,run,使用,tf,tensorflow,mean 来源: https://www.cnblogs.com/junblog/p/10622789.html