torch.jit.trace
torch.jit.trace(func, example_inputs=None, optimize=None, check_trace=True, check_inputs=None, check_tolerance=1e-05, strict=True, _force_outplace=False, _module_class=None, _compilation_unit=, example_kwarg_inputs=None)
Trace a function and return an executable  or "ScriptFunction" that
   will be optimized using just-in-time compilation. Tracing is ideal
   for code that operates only on "Tensor"s and lists, dictionaries,
   and tuples of "Tensor"s.
Using torch.jit.trace and torch.jit.trace_module, you can turn
   an existing module or Python function into a TorchScript
   "ScriptFunction" or "ScriptModule". You must provide example
   inputs, and we run the function, recording the operations performed
   on all the tensors.


The resulting recording of a standalone function produces
     ScriptFunction.


The resulting recording of nn.Module.forward or nn.Module
     produces ScriptModule.

