mirror of
https://github.com/zebrajr/tensorflow.git
synced 2026-01-15 12:15:41 +00:00
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:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user