You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,8 +151,8 @@ def get_shape(tensor):
151
151
152
152
Now imagine we want to convert a Tensor of rank 3 to a tensor of rank 2 by collapsing the second and third dimensions into one. We can use our get_shape() function to do that:
153
153
```python
154
-
b = placeholder(tf.float32, [None, 10, 32])
155
-
shape = get_shape(tensor)
154
+
b =tf.placeholder(tf.float32, [None, 10, 32])
155
+
shape = get_shape(b)
156
156
b = tf.reshape(b, [shape[0], shape[1] * shape[2]])
157
157
```
158
158
Note that this works whether the shapes are statically specified or not.
0 commit comments