Hi,
It depends how the back box is implemented.
If it is just pytorch code, then autograd can differentiate through the iterations (though it might be slow).
If you have some properties of the equilibrium that allow you to write dL/dinp = f(dL/dout), then you can use a custom autograd Function to tell the autograd how to differentiate this.