Jit.trace with optimize=True gives wrong output

When I trace a model with jit.trace and the optimize=True flag, I get a tracer warning saying that the outputs don’t match and the error is also significant. But when I trace with the flag set to False, everything is fine. Any idea why this might be happening?

Could you post a reproducible code example so that we could have a look?