I think you would have to call self.solve() in the forward method to properly script the model.
In eager mode you could still use a.solve(), but if I’m not mistaken, the JIT expects the “standard” implementation using forward.