tf.tile(
input,
multiples,
name=None
)
Args:
input
: ATensor
. 1-D or higher.multiples
: ATensor
. Must be one of the following types:int32
,int64
. 1-D. Length must be the same as the number of dimensions ininput
name
: A name for the operation (optional).
import tensorflow as tf
a = tf.constant([[1, 2], [3, 4], [5, 6]], dtype=tf.int32)
a1 = tf.tile(a, [3, 2])
print(a.get_shape())
print(a1.get_shape())
with tf.Session() as sess:
print(sess.run(a))
print(sess.run(a1))
(3, 2)
(9, 4)
先axis0方向貼3塊,然後axis1方向貼2塊。