mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-03 23:45:05 +08:00
Summary: Removed jit_language_reference_v2.md Test Plan: CI Rollback Plan: Differential Revision: D78308009 Pull Request resolved: https://github.com/pytorch/pytorch/pull/158305 Approved by: https://github.com/jingsh, https://github.com/svekars
31 lines
840 B
Markdown
31 lines
840 B
Markdown
```{eval-rst}
|
|
.. testsetup::
|
|
|
|
# These are hidden from the docs, but these are necessary for `doctest`
|
|
# since the `inspect` module doesn't play nicely with the execution
|
|
# environment for `doctest`
|
|
import torch
|
|
|
|
original_script = torch.jit.script
|
|
def script_wrapper(obj, *args, **kwargs):
|
|
obj.__module__ = 'FakeMod'
|
|
return original_script(obj, *args, **kwargs)
|
|
|
|
torch.jit.script = script_wrapper
|
|
|
|
original_trace = torch.jit.trace
|
|
def trace_wrapper(obj, *args, **kwargs):
|
|
obj.__module__ = 'FakeMod'
|
|
return original_trace(obj, *args, **kwargs)
|
|
|
|
torch.jit.trace = trace_wrapper
|
|
```
|
|
|
|
(language-reference-v2)=
|
|
|
|
# TorchScript Language Reference
|
|
|
|
:::{warning}
|
|
TorchScript is deprecated, please use
|
|
[torch.export](https://docs.pytorch.org/docs/stable/export.html) instead.
|
|
::: |