Set eval mode during optimization for mobile. (#35903)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35903
Eval mode must be set for module freezing, which is required for prepack
folding.
Test Plan: Test locally by transforming a model. As shown in the diff above this one.
Reviewed By: AshkanAliabadi
Differential Revision: D20824420
fbshipit-source-id: 6c226f44cca317b0333fb580ebbfd060128ae919