def ConvLayers(kernel_size,
               in_channels,
               out_channels,
               stride=1,
               pad_type='reflect',
               use_bias=True):
    """
    returns a list of [pad, conv] => should be += to some list, then apply sequential
    """

    if pad_type == 'reflect':
        pad = nn.ReflectionPad1d
    elif pad_type == 'replicate':
        pad = nn.ReplicationPad1d
    elif pad_type == 'zero':
        pad = ZeroPad1d
    else:
        assert 0, "Unsupported padding type: {}".format(pad_type)

    pad_l = (kernel_size - 1) // 2
    pad_r = kernel_size - 1 - pad_l
    return [
        pad((pad_l, pad_r)),
        nn.Conv1d(in_channels,
                  out_channels,
                  kernel_size=kernel_size,
                  stride=stride,
                  bias=use_bias)
    ]

    returns a list of [pad, conv] => should be += to some list, then apply sequential
    
mGPT/models/utils/blocks.py