def METHOD_NAME(self, input, class_dim=101):
    layers = self.layers
    seg_num = self.seg_num
    supported_layers = [50, 101, 152]
    assert layers in supported_layers, \
        "supported layers are {} but input layer is {}".format(supported_layers, layers)
    # reshape input
    channels = input.shape[2]
    short_size = input.shape[3]
    input = paddle.reshape(
        x=input, shape=[-1, channels, short_size, short_size])
    if layers == 50:
        depth = [3, 4, 6, 3]
    elif layers == 101:
        depth = [3, 4, 23, 3]
    elif layers == 152:
        depth = [3, 8, 36, 3]
    num_filters = [64, 128, 256, 512]
    conv = self.conv_bn_layer(input=input,
                              num_filters=64,
                              filter_size=7,
                              stride=2,
                              act='relu',
                              name='conv1')
    conv = paddle.nn.functional.max_pool2d(x=conv,
                               kernel_size=3,
                               stride=2,
                               padding=1)
    for block in range(len(depth)):
        for i in range(depth[block]):
            if layers in [101, 152] and block == 2:
                if i == 0:
                    conv_name = "res" + str(block + 2) + "a"
                else:
                    conv_name = "res" + str(block + 2) + "b" + str(i)
            else:
                conv_name = "res" + str(block + 2) + chr(97 + i)
            conv = self.bottleneck_block(
                input=conv,
                num_filters=num_filters[block],
                stride=2 if i == 0 and block != 0 else 1,
                name=conv_name)
    pool = paddle.nn.functional.adaptive_avg_pool2d(x=conv, output_size=1)
    feature = paddle.reshape(x=pool,
                                   shape=[-1, seg_num, pool.shape[1]])
    if self.is_extractor:
        out = feature
    else:
        out = paddle.mean(x=feature, axis=1)
        stdv = 1.0 / math.sqrt(pool.shape[1] * 1.0)
        out = static.nn.fc(
            x=out,
            size=class_dim,
            activation='softmax',
            weight_attr=paddle.ParamAttr(
                initializer=paddle.nn.initializer.Uniform(low=-stdv, high=stdv)))
    return out