Yes, you are welcome
But my solution is only an avoidance technique, because I think we can simply (and it’s better) define them as simple functions when there are no (learnable) parameters. Except that serialization fails in this case, if we define the function in the ordinary way.
For example, if I define our function above as below the serialization will fail by returning an error like : AttributeError: Can't pickle local object 'f.<locals>.g'
def f(prox_el) :
  def g(x, s=None) :
    return prox_el(x.unsqueeze(0)).squeeze()
  return g

On the other hand, if in my module I define an attribute like self.loss = F.mse_loss, which here is only a function, the serialization will succeed.
So a solution would be to see how pytorch defines its own functions.