import tensorflow as tf

        X = tf.reshape(X, (-1, in_w // 2, in_h // 2, out_ch)) # Sanity shape check

        return X

    def _add_batch_norm(self, X, in_ch, decay=0.9, epsilon=1e-5, offset=None, scale=None, is_train=False,
                        no_moving_average=False):
        with tf.variable_scope('batch_norm'):
            if offset is None:
                offset = self._make_var('offset', (in_ch,), init_constant=0)
            if scale is None:
                scale = self._make_var('scale', (in_ch,), init_constant=1)

