Solved by pascal_notsawo in post #4 
              
              
                Here is the modification I made, and it works. 
Since prox elements are only seen as functions in the end, there is no need to put them in a ModuleList. But you can still do it. 
class f(torch.nn.Module) :
    def __init__(self, prox_el) :
        super().__init__()
        self.prox_el = prox_el

 …