the method.
torch.utils.mobile_optimizer.optimize_for_mobile(script_module, optimization_blocklist=None, preserved_methods=None, backend='CPU')
Parameters:
      * script_module (ScriptModule) -- An instance of torch
        script module with type of ScriptModule.
  * **optimization_blocklist**
    (*Optional**[**Set**[**_MobileOptimizerType**]**]*) -- A set
    with type of MobileOptimizerType. When set is not passed,
    optimization method will run all the optimizer pass;
    otherwise, optimizer method will run the optimization pass
    that is not included inside optimization_blocklist.

  * **preserved_methods** (*Optional**[**List**]*) -- A list of
    methods that needed to be preserved when freeze_module pass is
    invoked

  * **backend** (*str*) -- Device type to use for running the
    result model ('CPU'(default), 'Vulkan' or 'Metal').

Returns:
      A new optimized torch script module
Return type:
      RecursiveScriptModule