1. 程式人生 > >tf.tile

tf.tile


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倍。