Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| tfe = tf.contrib.eager | |
| from libs.convolutions import Conv2D | |
| def hw_flatten(x): | |
| # Input shape x: [BATCH, HEIGHT, WIDTH, CHANNELS] | |
| # flat the feature volume across the width and height dimensions | |
| x_shape = tf.shape(x) | |
| return tf.reshape(x, [x_shape[0], -1, x_shape[-1]]) # return [BATCH, W*H, CHANNELS] |