replicate a row tensor using tf.tile?

前端 未结 6 1406
故里飘歌
故里飘歌 2021-01-01 17:19

I have a tensor which is simply a vector, vector = [0.5 0.4] and tf.shape indicates that it has shape=(1,), I would like to replicate the vector m times and hav

6条回答
  •  被撕碎了的回忆
    2021-01-01 17:46

    An answer without reshaping:

    vec = tf.constant([[1, 2, 3, 4]])
    multiply = tf.constant([3, 1])
    tf.tile(vec, multiply)
    

提交回复
热议问题