DigitMagazine

Reshape operation to create single dimensional tensor

Jul 25th, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. def create_flatten_layer(layer):
  2. layer_shape = layer.get_shape()
  3. num_features = layer_shape[1:4].num_elements()
  4. layer = tf.reshape(layer, [-1, num_features])
  5. return layer
Add Comment
Please, Sign In to add comment