flâneur — a map of the web's best reading

Extending TorchScript with Custom C++ Operators — PyTorch Tutorials 1.13.1+cu117 documentation

pytorch.org · 158 words · saved by 1 readers

The PyTorch 1.0 release introduced a new programming model to PyTorch called TorchScript. TorchScript is a subset of the Python programming language which can be parsed, compiled and optimized by the TorchScript compiler. Further, compiled TorchScript models have the option of being serialized into an on-disk file format, which you can subsequently load and run from pure C++ (as well as Python) for inference. TorchScript supports a large subset of operations provided by the torch package, allowing you to express many kinds of complex models purely as a series of tensor operations from PyTorch’s “standard library”. Nevertheless, there may be times where you find yourself in need of extending TorchScript with a custom C++ or CUDA function. While we recommend that you only resort to this option if your idea cannot be expressed (efficiently enough) as a simple Python function, we do provide a very friendly and simple interface for defining custom C++ and CUDA kernels using ATen, PyTorch’s

<no title> — PyTorch Tutorials 2.13.0+cu130 documentation Skip to main content Back to top Ctrl + K v2.13.0+cu130 Go to pytorch.org Ctrl + K X GitHub Discourse PyPi Rate this Page ★ ★ ★ ★ ★ advanced/torch_script_custom_ops Run in Google Colab Colab Download Notebook Notebook View on GitHub GitHub Warning TorchScript is deprecated, please use torch.export instead. On this page PyTorch Libraries ExecuTorch Helion torchao kineto torchtitan TorchRL torchvision torchaudio tensordict PyTorch on XLA Devices so the DOM is not blocked --> Docs Access comprehensive developer documentation for PyTorch Vi

Explore this link on the map →

related reading