def test_mode(model, L, mode=0, refield=32, min_size=256, sf=1, modulo=1):
    '''
    # ---------------------------------------
    # Kai Zhang (github: https://github.com/cszn)
    # 03/Mar/2019
    # ---------------------------------------
    Args:
        model: trained model
        L: input Low-quality image
        mode:
            (0) normal: test(model, L)
            (1) pad: test_pad(model, L, modulo=16)
            (2) split: test_split(model, L, refield=32, min_size=256, sf=1, modulo=1)
            (3) x8: test_x8(model, L, modulo=1) ^_^
            (4) split and x8: test_split_x8(model, L, refield=32, min_size=256, sf=1, modulo=1)
        refield: effective receptive filed of the network, 32 is enough
            useful when split, i.e., mode=2, 4
        min_size: min_sizeXmin_size image, e.g., 256X256 image
            useful when split, i.e., mode=2, 4
        sf: scale factor for super-resolution, otherwise 1
        modulo: 1 if split
            useful when pad, i.e., mode=1

    Returns:
        E: estimated image
    # ---------------------------------------
    '''
    if mode == 0:
        E = test(model, L)
    elif mode == 1:
        E = test_pad(model, L, modulo, sf)
    elif mode == 2:
        E = test_split(model, L, refield, min_size, sf, modulo)
    elif mode == 3:
        E = test_x8(model, L, modulo, sf)
    elif mode == 4:
        E = test_split_x8(model, L, refield, min_size, sf, modulo)
    return E

    # ---------------------------------------
    # Kai Zhang (github: https://github.com/cszn)
    # 03/Mar/2019
    # ---------------------------------------
    Args:
        model: trained model
        L: input Low-quality image
        mode:
            (0) normal: test(model, L)
            (1) pad: test_pad(model, L, modulo=16)
            (2) split: test_split(model, L, refield=32, min_size=256, sf=1, modulo=1)
            (3) x8: test_x8(model, L, modulo=1) ^_^
            (4) split and x8: test_split_x8(model, L, refield=32, min_size=256, sf=1, modulo=1)
        refield: effective receptive filed of the network, 32 is enough
            useful when split, i.e., mode=2, 4
        min_size: min_sizeXmin_size image, e.g., 256X256 image
            useful when split, i.e., mode=2, 4
        sf: scale factor for super-resolution, otherwise 1
        modulo: 1 if split
            useful when pad, i.e., mode=1

    Returns:
        E: estimated image
    # ---------------------------------------
    
utils/utils_model.py