__init__.py 348 字节
Newer Older
C
update  
ceci3 已提交
1 2 3
"""Based on https://github.com/mit-han-lab/gan-compression """


C
ceci3 已提交
4 5 6 7 8 9 10 11 12
def encode_config(config):
    return '_'.join([str(c) for c in config['channels']])


def decode_config(config_str):
    channels = config_str.split('_')
    assert len(channels) == 6 or len(channels) == 8
    channels = [int(c) for c in channels]
    return {'channels': channels}