replicate a row tensor using tf.tile?

前端 未结 6 1409
故里飘歌
故里飘歌 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:27

    Tensorflow 2.0 solution: Refer to this link to read more about tf.tile

    vector = [0.5, 0.4]
    tf.reshape(tf.tile(vector, [2]), [2, tf.shape(vector)[0]])
    
    # output 
    
    

提交回复
热议问题