tf.transpose()

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/luoganttcc/article/details/83411539
import tensorflow as tf; 
import numpy as np; 
x = tf.constant([[1, 2, 3], [4, 5, 6]])
cc=tf.transpose(x)
init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)          # Very important

print(sess.run(x))
print(sess.run(cc))

[[1 2 3]
 [4 5 6]]
[[1 4]
 [2 5]
 [3 6]]

猜你喜欢

转载自blog.csdn.net/luoganttcc/article/details/83411539
今日推荐