标签:flow 图片 div import bsp session shape src res
import tensorflow as tf x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] with tf.Session() as sess: a = tf.reshape(x, [2, 2, 3]) a = sess.run(a) print(a) print("----------------------------") b = tf.reshape(a,[3,2,2]) b = sess.run(b) print(b) print("-----------------------------") c = tf.transpose(b,[1,2,0]) c = sess.run(c) print(c) 结果: [[[ 1 2 3] [ 4 5 6]] [[ 7 8 9] [10 11 12]]] ---------------------------- [[[ 1 2] [ 3 4]] [[ 5 6] [ 7 8]] [[ 9 10] [11 12]]] ----------------------------- [[[ 1 5 9] [ 2 6 10]] [[ 3 7 11] [ 4 8 12]]]
标签:flow 图片 div import bsp session shape src res
原文地址:https://www.cnblogs.com/LiuXinyu12378/p/12246779.html