tensorflow tf.tile使用 分手后的思念是犯贱 2022-05-14 07:08 148阅读 0赞 import tensorflow as tf temp = tf.tile([1,2,3],[2]) temp2 = tf.tile([[1,2],[3,4],[5,6]],[2,3]) with tf.Session() as sess: print(sess.run(temp)) print(sess.run(temp2)) # out [1 2 3 1 2 3] [[1 2 1 2 1 2] [3 4 3 4 3 4] [5 6 5 6 5 6] [1 2 1 2 1 2] [3 4 3 4 3 4] [5 6 5 6 5 6]] import tensorflow as tf temp = tf.tile([[1,2,3],[1,2,3]],[1,1]) temp2 = tf.tile([[1,2,3],[1,2,3]],[2,1]) temp3 = tf.tile([[1,2,3],[1,2,3]],[2,2]) with tf.Session() as sess: print(sess.run(temp)) print(sess.run(temp2)) print(sess.run(temp3)) # out [[1 2 3] [1 2 3]] [[1 2 3] [1 2 3] [1 2 3] [1 2 3]] [[1 2 3 1 2 3] [1 2 3 1 2 3] [1 2 3 1 2 3] [1 2 3 1 2 3]]
还没有评论,来说两句吧...