tf.transpose()

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]]
posted @ 2018-10-26 10:51  luoganttcc  阅读(96)  评论(0编辑  收藏  举报