import tensorflow as tf
a = tf.constant([[1, 2], [3, 4], [5, 6]], dtype=tf.float32)
a1 = tf.tile(a, [4, 3])
with tf.Session() as sess:
print(sess.run(a))
print(sess.run(a1))
tf.tile这个函数中的[4,3]表示,第一维扩展4倍,第二维扩展3倍。
import tensorflow as tf
a = tf.constant([[1, 2], [3, 4], [5, 6]], dtype=tf.float32)
a1 = tf.tile(a, [4, 3])
with tf.Session() as sess:
print(sess.run(a))
print(sess.run(a1))
tf.tile这个函数中的[4,3]表示,第一维扩展4倍,第二维扩展3倍。