I also realized that there is no way to reuse the optimizer and continue the training after the resize without changing its internal state (and therefore having code that may break in the future releases)