From af86d67d612c76640f63724cd96869df94b91d33 Mon Sep 17 00:00:00 2001 From: Aidyn-A Date: Fri, 15 Mar 2024 20:26:44 +0000 Subject: [PATCH] [Doc][NVTX] Add documentation for nvtx.range (#121699) The context manager `torch.cuda.nvtx.range` has been around for about 4 years (see #42925). Unfortunately, it was never documented and as a consequence users are just unaware of it (see #121663). Pull Request resolved: https://github.com/pytorch/pytorch/pull/121699 Approved by: https://github.com/janeyx99 --- docs/source/cuda.rst | 3 ++- torch/jit/supported_ops.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/source/cuda.rst b/docs/source/cuda.rst index 33b697a288f80..cee1ec6af2e8a 100644 --- a/docs/source/cuda.rst +++ b/docs/source/cuda.rst @@ -133,6 +133,7 @@ NVIDIA Tools Extension (NVTX) nvtx.mark nvtx.range_push nvtx.range_pop + nvtx.range Jiterator (beta) ----------------------------- @@ -167,4 +168,4 @@ See the :doc:`documentation ` for information on how to use it. .. py:module:: torch.cuda.profiler .. py:module:: torch.cuda.random .. py:module:: torch.cuda.sparse -.. py:module:: torch.cuda.streams \ No newline at end of file +.. py:module:: torch.cuda.streams diff --git a/torch/jit/supported_ops.py b/torch/jit/supported_ops.py index 7a670c722744e..61c865a3a0569 100644 --- a/torch/jit/supported_ops.py +++ b/torch/jit/supported_ops.py @@ -276,7 +276,9 @@ def _get_global_builtins(): if len(schemas) > 0: schematized_ops.append("") else: - table_row = f'":any:`{fn}`", "{schemaless_op_explanations[fn]}"' + table_row = ( + f'":external+python:py:obj:`{fn}`", "{schemaless_op_explanations[fn]}"' + ) schemaless_ops.append(table_row) schematized_ops_str = "\n".join(schematized_ops)