Is there a tensorflow equivalent to np.empty?

后端 未结 3 1132
误落风尘
误落风尘 2021-01-18 10:39

Numpy has this helper function, np.empty, which will:

Return a new array of given shape and type, without initializing entries.

3条回答
  •  遇见更好的自我
    2021-01-18 11:15

    If you're creating an empty tensor, tf.zeros will do

    >>> a = tf.zeros([0, 4])
    >>> tf.concat([a, [[1, 2, 3, 4], [5, 6, 7, 8]]], axis=0)
    
    

提交回复
热议问题