Solved by ptrblck in post #2 
              
              
                Since you are changing the parameters, you would need to pass these new parameters to the optimizer (or create a new one). The running stats in this optimizer would be lost in this case (if it’s using internal estimates).