def get_out_channel(layer):
    if hasattr(layer, 'out_channels'):
        return getattr(layer, 'out_channels')
    return layer.weight.size(0)
def get_out_channel(layer):
    if hasattr(layer, 'out_channels'):
        return getattr(layer, 'out_channels')
    return layer.weight.size(0)