import tensorflow as tf

        # If channel counts finally don't match, convert channel counts with 1x1 conv
        if ch != ch_out:
            with tf.variable_scope('convert_conv'):
                X = self._do_conv(X, w, h, ch, ch_out, filter_size=1, is_train=is_train)

        X = tf.reshape(X, (-1, w_out, h_out, ch_out)) # Sanity shape check
        return X

    def _add_fully_connected(self, X, in_shape, out_ch, no_reg=False):
        ch = np.prod(in_shape)
        X = tf.reshape(X, (-1, ch))
        W = self._make_var('W', (ch, out_ch), no_reg=no_reg)
        X = tf.matmul(X, W)
        X = tf.reshape(X, (-1, out_ch)) # Sanity shape check
        return X

    def _add_factorized_reduction(self, X, in_w, in_h, in_ch, out_ch, is_train=False):
        '''
        Output is of shape (in_w // 2, in_h // 2, out_ch)
        '''
