@pytorcher You are probably using an older version of pytorch then. The method is added in 0.3. I highly suggest upgrading as 0.3 includes many new features, bug fixes, and speed increases. Also, creating a new optimizer at each epoch will be problematic if you want to apply momentum, as it basically throws away the momentum information.