I wanted to use the tf.where
function in tensorflow.
selected_data = tf.where(mask,some_place_holder,zeros)
however, when I wrote
zeros = tf.zeros(some_place_holder.shape)
error occurs:
ValueError: Cannot convert a partially known TensorShape to a Tensor: (?, 1000, 10)
I also tried to use tf.fill
, but similar errors occured.
Well, there indeed some solution such as
zeros = tf.matmul(some_place_holder , tf.zeros([some_place_holder.shape[-1],some_place_holder.shape[-1]]))
but is there any better solution?