```
if 'args' in layer:
    args = layer.pop('args')
    old_fun = fun
    fun = lambda x: old_fun(x,*args)
```

That's my solution :)