torch.jit.freeze
torch.jit.freeze(mod, preserved_attrs=None, optimize_numerics=True)
Freezing a "ScriptModule" will clone it and attempt to inline the
   cloned module's submodules, parameters, and attributes as constants
   in the TorchScript IR Graph. By default, forward will be
   preserved, as well as attributes & methods specified in
   preserved_attrs. Additionally, any attribute that is modified
   within a preserved method will be preserved.
Freezing currently only accepts ScriptModules that are in eval
   mode.
Freezing applies generic optimization that will speed up your model
   regardless of machine. To further optimize using server-specific
   settings, run optimize_for_inference after freezing.
Parameters:
      * mod ("ScriptModule") -- a module to be frozen
  * **preserved_attrs** (*Optional**[**List**[**str**]**]*) -- a
    list of attributes to preserve in addition to the forward
