Skip to content

Commit 6689127

Browse files
authored
Merge branch 'main' into zzb_fsdp_add_event_sync
2 parents 532d438 + 7f76cfd commit 6689127

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

advanced_source/custom_ops_landing_page.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ You may wish to author a custom operator from Python (as opposed to C++) if:
2323
respect to ``torch.compile`` and ``torch.export``.
2424
- you have some Python bindings to C++/CUDA kernels and want those to compose with PyTorch
2525
subsystems (like ``torch.compile`` or ``torch.autograd``)
26+
- you are using Python (and not a C++-only environment like AOTInductor).
2627

2728
Integrating custom C++ and/or CUDA code with PyTorch
2829
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

advanced_source/python_custom_ops.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
.. _python-custom-ops-tutorial:
55
6-
Python Custom Operators
6+
Custom Python Operators
77
=======================
88
99
.. grid:: 2
@@ -30,6 +30,12 @@
3030
into the function).
3131
- Adding training support to an arbitrary Python function
3232
33+
Use :func:`torch.library.custom_op` to create Python custom operators.
34+
Use the C++ ``TORCH_LIBRARY`` APIs to create C++ custom operators (these
35+
work in Python-less environments).
36+
See the `Custom Operators Landing Page <https://pytorch.org/tutorials/advanced/custom_ops_landing_page.html>`_
37+
for more details.
38+
3339
Please note that if your operation can be expressed as a composition of
3440
existing PyTorch operators, then there is usually no need to use the custom operator
3541
API -- everything (for example ``torch.compile``, training support) should

index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,14 @@ Welcome to PyTorch Tutorials
397397
:tags: Frontend-APIs,C++
398398

399399
.. customcarditem::
400-
:header: Python Custom Operators Landing Page
400+
:header: PyTorch Custom Operators Landing Page
401401
:card_description: This is the landing page for all things related to custom operators in PyTorch.
402402
:image: _static/img/thumbnails/cropped/Custom-Cpp-and-CUDA-Extensions.png
403403
:link: advanced/custom_ops_landing_page.html
404404
:tags: Extending-PyTorch,Frontend-APIs,C++,CUDA
405405

406406
.. customcarditem::
407-
:header: Python Custom Operators
407+
:header: Custom Python Operators
408408
:card_description: Create Custom Operators in Python. Useful for black-boxing a Python function for use with torch.compile.
409409
:image: _static/img/thumbnails/cropped/Custom-Cpp-and-CUDA-Extensions.png
410410
:link: advanced/python_custom_ops.html

0 commit comments

Comments
 (0)