Skip to content

Commit cb7ef0f

Browse files
committed
Generate Python docs from pytorch/pytorch@8d4b8a9
1 parent 5ae409f commit cb7ef0f

27 files changed

+198
-192
lines changed

2.6/_images/RReLU.png

-93 Bytes
Loading

2.6/_modules/torch/serialization.html

+12-6
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,13 @@ <h1>Source code for torch.serialization</h1><div class="highlight"><pre>
661661

662662
<span class="n">IS_WINDOWS</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">platform</span> <span class="o">==</span> <span class="s2">&quot;win32&quot;</span>
663663

664+
<span class="n">UNSAFE_MESSAGE</span> <span class="o">=</span> <span class="p">(</span>
665+
<span class="s2">&quot;In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` &quot;</span>
666+
<span class="s2">&quot;from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, &quot;</span>
667+
<span class="s2">&quot;but it can result in arbitrary code execution. Do it only if you got the file from a &quot;</span>
668+
<span class="s2">&quot;trusted source.&quot;</span>
669+
<span class="p">)</span>
670+
664671
<span class="k">if</span> <span class="ow">not</span> <span class="n">IS_WINDOWS</span><span class="p">:</span>
665672
<span class="kn">from</span> <span class="nn">mmap</span> <span class="kn">import</span> <span class="n">MAP_PRIVATE</span><span class="p">,</span> <span class="n">MAP_SHARED</span>
666673
<span class="k">else</span><span class="p">:</span>
@@ -1900,12 +1907,6 @@ <h1>Source code for torch.serialization</h1><div class="highlight"><pre>
19001907
<span class="sd"> &gt;&gt;&gt; torch.load(&quot;module.pt&quot;, encoding=&quot;ascii&quot;, weights_only=False)</span>
19011908
<span class="sd"> &quot;&quot;&quot;</span>
19021909
<span class="n">torch</span><span class="o">.</span><span class="n">_C</span><span class="o">.</span><span class="n">_log_api_usage_once</span><span class="p">(</span><span class="s2">&quot;torch.load&quot;</span><span class="p">)</span>
1903-
<span class="n">UNSAFE_MESSAGE</span> <span class="o">=</span> <span class="p">(</span>
1904-
<span class="s2">&quot;In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` &quot;</span>
1905-
<span class="s2">&quot;from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, &quot;</span>
1906-
<span class="s2">&quot;but it can result in arbitrary code execution. Do it only if you got the file from a &quot;</span>
1907-
<span class="s2">&quot;trusted source.&quot;</span>
1908-
<span class="p">)</span>
19091910
<span class="n">DOCS_MESSAGE</span> <span class="o">=</span> <span class="p">(</span>
19101911
<span class="s2">&quot;</span><span class="se">\n\n</span><span class="s2">Check the documentation of torch.load to learn more about types accepted by default with &quot;</span>
19111912
<span class="s2">&quot;weights_only https://pytorch.org/docs/stable/generated/torch.load.html.&quot;</span>
@@ -2168,6 +2169,11 @@ <h1>Source code for torch.serialization</h1><div class="highlight"><pre>
21682169
<span class="k">with</span> <span class="n">closing</span><span class="p">(</span>
21692170
<span class="n">tarfile</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">fileobj</span><span class="o">=</span><span class="n">f</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">&quot;r:&quot;</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="n">tarfile</span><span class="o">.</span><span class="n">PAX_FORMAT</span><span class="p">)</span>
21702171
<span class="p">)</span> <span class="k">as</span> <span class="n">tar</span><span class="p">,</span> <span class="n">mkdtemp</span><span class="p">()</span> <span class="k">as</span> <span class="n">tmpdir</span><span class="p">:</span>
2172+
<span class="k">if</span> <span class="n">pickle_module</span> <span class="ow">is</span> <span class="n">_weights_only_unpickler</span><span class="p">:</span>
2173+
<span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span>
2174+
<span class="s2">&quot;Cannot use ``weights_only=True`` with files saved in the &quot;</span>
2175+
<span class="s2">&quot;legacy .tar format. &quot;</span> <span class="o">+</span> <span class="n">UNSAFE_MESSAGE</span>
2176+
<span class="p">)</span>
21712177
<span class="n">tar</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="s2">&quot;storages&quot;</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="n">tmpdir</span><span class="p">)</span>
21722178
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tmpdir</span><span class="p">,</span> <span class="s2">&quot;storages&quot;</span><span class="p">),</span> <span class="s2">&quot;rb&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
21732179
<span class="n">num_storages</span> <span class="o">=</span> <span class="n">pickle_module</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="o">**</span><span class="n">pickle_load_args</span><span class="p">)</span>

2.6/_sources/generated/exportdb/index.rst.txt

+12-12
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ support in export please create an issue in the pytorch/pytorch repo with a modu
1919
:caption: Tags
2020

2121
torch.escape-hatch
22-
torch.cond
2322
torch.dynamic-shape
23+
torch.cond
2424
python.closure
2525
torch.dynamic-value
2626
python.data-structure
@@ -212,7 +212,7 @@ cond_branch_class_method
212212

213213
.. note::
214214

215-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
215+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
216216

217217
Support Level: SUPPORTED
218218

@@ -288,7 +288,7 @@ cond_branch_nested_function
288288

289289
.. note::
290290

291-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
291+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
292292

293293
Support Level: SUPPORTED
294294

@@ -361,7 +361,7 @@ cond_branch_nonlocal_variables
361361

362362
.. note::
363363

364-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
364+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
365365

366366
Support Level: SUPPORTED
367367

@@ -458,7 +458,7 @@ cond_closed_over_variable
458458

459459
.. note::
460460

461-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`python.closure <python.closure>`
461+
Tags: :doc:`python.closure <python.closure>`, :doc:`torch.cond <torch.cond>`
462462

463463
Support Level: SUPPORTED
464464

@@ -527,7 +527,7 @@ cond_operands
527527

528528
.. note::
529529

530-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
530+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
531531

532532
Support Level: SUPPORTED
533533

@@ -613,7 +613,7 @@ cond_predicate
613613

614614
.. note::
615615

616-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
616+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
617617

618618
Support Level: SUPPORTED
619619

@@ -670,7 +670,7 @@ constrain_as_size_example
670670

671671
.. note::
672672

673-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
673+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
674674

675675
Support Level: SUPPORTED
676676

@@ -737,7 +737,7 @@ constrain_as_value_example
737737

738738
.. note::
739739

740-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
740+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
741741

742742
Support Level: SUPPORTED
743743

@@ -1286,7 +1286,7 @@ list_contains
12861286

12871287
.. note::
12881288

1289-
Tags: :doc:`python.assert <python.assert>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.data-structure <python.data-structure>`
1289+
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.assert <python.assert>`
12901290

12911291
Support Level: SUPPORTED
12921292

@@ -1936,7 +1936,7 @@ dynamic_shape_round
19361936

19371937
.. note::
19381938

1939-
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.builtin <python.builtin>`
1939+
Tags: :doc:`python.builtin <python.builtin>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
19401940

19411941
Support Level: NOT_SUPPORTED_YET
19421942

@@ -2109,6 +2109,6 @@ Result:
21092109

21102110
.. code-block::
21112111
2112-
Unsupported: torch.* op returned non-Tensor int call_function <function sym_min at 0x7fe43a0f2790>
2112+
Unsupported: torch.* op returned non-Tensor int call_function <function sym_min at 0x7f638165a790>
21132113
21142114

2.6/_sources/generated/exportdb/python.assert.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ list_contains
5454

5555
.. note::
5656

57-
Tags: :doc:`python.assert <python.assert>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.data-structure <python.data-structure>`
57+
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.assert <python.assert>`
5858

5959
Support Level: SUPPORTED
6060

2.6/_sources/generated/exportdb/python.builtin.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dynamic_shape_round
55

66
.. note::
77

8-
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.builtin <python.builtin>`
8+
Tags: :doc:`python.builtin <python.builtin>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
99

1010
Support Level: NOT_SUPPORTED_YET
1111

2.6/_sources/generated/exportdb/python.closure.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cond_closed_over_variable
55

66
.. note::
77

8-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`python.closure <python.closure>`
8+
Tags: :doc:`python.closure <python.closure>`, :doc:`torch.cond <torch.cond>`
99

1010
Support Level: SUPPORTED
1111

2.6/_sources/generated/exportdb/python.data-structure.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ list_contains
127127

128128
.. note::
129129

130-
Tags: :doc:`python.assert <python.assert>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.data-structure <python.data-structure>`
130+
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.assert <python.assert>`
131131

132132
Support Level: SUPPORTED
133133

2.6/_sources/generated/exportdb/torch.cond.rst.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cond_branch_class_method
55

66
.. note::
77

8-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
8+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
99

1010
Support Level: SUPPORTED
1111

@@ -81,7 +81,7 @@ cond_branch_nested_function
8181

8282
.. note::
8383

84-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
84+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
8585

8686
Support Level: SUPPORTED
8787

@@ -154,7 +154,7 @@ cond_branch_nonlocal_variables
154154

155155
.. note::
156156

157-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
157+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
158158

159159
Support Level: SUPPORTED
160160

@@ -251,7 +251,7 @@ cond_closed_over_variable
251251

252252
.. note::
253253

254-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`python.closure <python.closure>`
254+
Tags: :doc:`python.closure <python.closure>`, :doc:`torch.cond <torch.cond>`
255255

256256
Support Level: SUPPORTED
257257

@@ -320,7 +320,7 @@ cond_operands
320320

321321
.. note::
322322

323-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
323+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
324324

325325
Support Level: SUPPORTED
326326

@@ -406,7 +406,7 @@ cond_predicate
406406

407407
.. note::
408408

409-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
409+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
410410

411411
Support Level: SUPPORTED
412412

2.6/_sources/generated/exportdb/torch.dynamic-shape.rst.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cond_branch_class_method
55

66
.. note::
77

8-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
8+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
99

1010
Support Level: SUPPORTED
1111

@@ -81,7 +81,7 @@ cond_branch_nested_function
8181

8282
.. note::
8383

84-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
84+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
8585

8686
Support Level: SUPPORTED
8787

@@ -154,7 +154,7 @@ cond_branch_nonlocal_variables
154154

155155
.. note::
156156

157-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
157+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
158158

159159
Support Level: SUPPORTED
160160

@@ -251,7 +251,7 @@ cond_operands
251251

252252
.. note::
253253

254-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
254+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
255255

256256
Support Level: SUPPORTED
257257

@@ -337,7 +337,7 @@ cond_predicate
337337

338338
.. note::
339339

340-
Tags: :doc:`torch.cond <torch.cond>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
340+
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`torch.cond <torch.cond>`
341341

342342
Support Level: SUPPORTED
343343

@@ -550,7 +550,7 @@ dynamic_shape_round
550550

551551
.. note::
552552

553-
Tags: :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.builtin <python.builtin>`
553+
Tags: :doc:`python.builtin <python.builtin>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`
554554

555555
Support Level: NOT_SUPPORTED_YET
556556

@@ -694,7 +694,7 @@ list_contains
694694

695695
.. note::
696696

697-
Tags: :doc:`python.assert <python.assert>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.data-structure <python.data-structure>`
697+
Tags: :doc:`python.data-structure <python.data-structure>`, :doc:`torch.dynamic-shape <torch.dynamic-shape>`, :doc:`python.assert <python.assert>`
698698

699699
Support Level: SUPPORTED
700700

2.6/_sources/generated/exportdb/torch.dynamic-value.rst.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ constrain_as_size_example
55

66
.. note::
77

8-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
8+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
99

1010
Support Level: SUPPORTED
1111

@@ -72,7 +72,7 @@ constrain_as_value_example
7272

7373
.. note::
7474

75-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
75+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
7676

7777
Support Level: SUPPORTED
7878

2.6/_sources/generated/exportdb/torch.escape-hatch.rst.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ constrain_as_size_example
5757

5858
.. note::
5959

60-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
60+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
6161

6262
Support Level: SUPPORTED
6363

@@ -124,7 +124,7 @@ constrain_as_value_example
124124

125125
.. note::
126126

127-
Tags: :doc:`torch.dynamic-value <torch.dynamic-value>`, :doc:`torch.escape-hatch <torch.escape-hatch>`
127+
Tags: :doc:`torch.escape-hatch <torch.escape-hatch>`, :doc:`torch.dynamic-value <torch.dynamic-value>`
128128

129129
Support Level: SUPPORTED
130130

2.6/_sources/generated/exportdb/torch.operator.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ Result:
3939

4040
.. code-block::
4141
42-
Unsupported: torch.* op returned non-Tensor int call_function <function sym_min at 0x7fe43a0f2790>
42+
Unsupported: torch.* op returned non-Tensor int call_function <function sym_min at 0x7f638165a790>

0 commit comments

Comments
 (0)