torch.utils.mobile_optimizer
Warning:
This API is in beta and may change in the near future.
Torch mobile supports
"torch.utils.mobile_optimizer.optimize_for_mobile" utility to run a
list of optimization pass with modules in eval mode. The method takes
the following parameters: a torch.jit.ScriptModule object, a
blocklisting optimization set, a preserved method list, and a backend.
For CPU Backend, by default, if optimization blocklist is None or
empty, "optimize_for_mobile" will run the following optimizations:
   * Conv2D + BatchNorm fusion (blocklisting option
     mobile_optimizer.MobileOptimizerType.CONV_BN_FUSION):  This
     optimization pass folds "Conv2d-BatchNorm2d" into "Conv2d" in
     "forward" method of this module and all its submodules. The
     weight and bias of the "Conv2d" are correspondingly updated.

Insert and Fold prepacked ops (blocklisting option
     mobile_optimizer.MobileOptimizerType.INSERT_FOLD_PREPACK_OPS):
