tf.zeros doesn't accept a tensor argument

ValueError: Shape must be rank 1 but is rank 0 for 'zeros_2' (op: 'Fill') with input shapes: [], [].
This commit is contained in:
田传武 2017-10-27 02:08:44 -05:00 committed by Larry Tin
parent 231ca9dd4e
commit 36696ad583

View File

@ -197,7 +197,7 @@ For example, here is how to make a vector of zeros with the same size as the
number of columns in a given matrix:
``` python
zeros = tf.zeros(tf.shape(my_matrix)[1])
zeros = tf.zeros(my_matrix.shape[1])
```
### Changing the shape of a `tf.Tensor`