(C_i, P_j, scope)
i = j+1
    :param C_i: shape is [1, h, w, c]
    :param P_j: shape is [1, h/2, w/2, 256]
    :return:
    P_i
i = j+1
    :param C_i: shape is [1, h, w, c]
    :param P_j: shape is [1, h/2, w/2, 256]
    :return:
    P_i
i = j + 1 : param C_i : shape is [ 1 h w c ] : param P_j : shape is [ 1 h / 2 w / 2 256 ] : return : P_i
def fusion_two_layer(C_i, P_j, scope):
    '''
    i = j+1
    :param C_i: shape is [1, h, w, c]
    :param P_j: shape is [1, h/2, w/2, 256]
    :return:
    P_i
    '''
    with tf.variable_scope(scope):
        level_name = scope.split('_')[1]

        h, w = tf.shape(C_i)[1], tf.shape(C_i)[2]
        upsample_p = tf.image.resize_bilinear(P_j,
                                              size=[h, w],
                                              name='up_sample_'+level_name)

        reduce_dim_c = slim.conv2d(C_i,
                                   num_outputs=256,
                                   kernel_size=[1, 1], stride=1,
                                   scope='reduce_dim_'+level_name)

        add_f = 0.5*upsample_p + 0.5*reduce_dim_c

        # P_i = slim.conv2d(add_f,
        #                   num_outputs=256, kernel_size=[3, 3], stride=1,
        #                   padding='SAME',
        #                   scope='fusion_'+level_name)
        return add_f
def fusion_two_layer ( C_i , P_j , scope ) : with tf . variable_scope ( scope ) : level_name = scope . split ( '_' ) [ 1 ] h , w = tf . shape ( C_i ) [ 1 ] , tf . shape ( C_i ) [ 2 ] upsample_p = tf . image . resize_bilinear ( P_j , size = [ h , w ] , name = 'up_sample_' + level_name ) reduce_dim_c = slim . conv2d ( C_i , num_outputs = 256 , kernel_size = [ 1 , 1 ] , stride = 1 , scope = 'reduce_dim_' + level_name ) add_f = 0.5 * upsample_p + 0.5 * reduce_dim_c # P_i = slim.conv2d(add_f, #                   num_outputs=256, kernel_size=[3, 3], stride=1, #                   padding='SAME', #                   scope='fusion_'+level_name) return add_f