Skip to content

Commit

Permalink
Generate Python docs from pytorch/pytorch@0052943
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchbot committed Dec 7, 2024
1 parent 1980bef commit 236fc3e
Show file tree
Hide file tree
Showing 41 changed files with 101 additions and 47 deletions.
2 changes: 1 addition & 1 deletion nightly/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
70 changes: 62 additions & 8 deletions nightly/_modules/torch/_functorch/aot_autograd.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down Expand Up @@ -389,7 +389,19 @@ <h1>Source code for torch._functorch.aot_autograd</h1><div class="highlight"><pr
<span class="kn">import</span> <span class="nn">itertools</span>
<span class="kn">from</span> <span class="nn">contextlib</span> <span class="kn">import</span> <span class="n">contextmanager</span><span class="p">,</span> <span class="n">nullcontext</span>
<span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="n">partial</span><span class="p">,</span> <span class="n">wraps</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">NewType</span><span class="p">,</span> <span class="n">Optional</span><span class="p">,</span> <span class="n">Tuple</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">Any</span><span class="p">,</span>
<span class="n">Callable</span><span class="p">,</span>
<span class="n">Dict</span><span class="p">,</span>
<span class="n">List</span><span class="p">,</span>
<span class="n">NewType</span><span class="p">,</span>
<span class="n">Optional</span><span class="p">,</span>
<span class="n">Protocol</span><span class="p">,</span>
<span class="n">Sequence</span><span class="p">,</span>
<span class="n">Tuple</span><span class="p">,</span>
<span class="n">Type</span><span class="p">,</span>
<span class="n">TypeVar</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">unittest.mock</span> <span class="kn">import</span> <span class="n">patch</span>

<span class="kn">import</span> <span class="nn">torch</span>
Expand All @@ -407,7 +419,8 @@ <h1>Source code for torch._functorch.aot_autograd</h1><div class="highlight"><pr
<span class="n">preserve_rng_state</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">torch._guards</span> <span class="kn">import</span> <span class="n">detect_fake_mode</span>
<span class="kn">from</span> <span class="nn">torch._inductor.utils</span> <span class="kn">import</span> <span class="n">BoxedBool</span>
<span class="kn">from</span> <span class="nn">torch._inductor.output_code</span> <span class="kn">import</span> <span class="n">OutputCode</span>
<span class="kn">from</span> <span class="nn">torch._inductor.utils</span> <span class="kn">import</span> <span class="n">BoxedBool</span><span class="p">,</span> <span class="n">InputType</span>
<span class="kn">from</span> <span class="nn">torch._subclasses</span> <span class="kn">import</span> <span class="n">FakeTensor</span><span class="p">,</span> <span class="n">FakeTensorMode</span>
<span class="kn">from</span> <span class="nn">torch.fx.experimental.proxy_tensor</span> <span class="kn">import</span> <span class="n">make_fx</span>
<span class="kn">from</span> <span class="nn">torch.fx.experimental.symbolic_shapes</span> <span class="kn">import</span> <span class="n">ShapeEnv</span>
Expand Down Expand Up @@ -821,6 +834,47 @@ <h1>Source code for torch._functorch.aot_autograd</h1><div class="highlight"><pr
<span class="n">FakifiedFlatArgs</span> <span class="o">=</span> <span class="n">NewType</span><span class="p">(</span><span class="s2">&quot;FakifiedFlatArgs&quot;</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Any</span><span class="p">])</span>


<span class="n">TOutputCode</span> <span class="o">=</span> <span class="n">TypeVar</span><span class="p">(</span><span class="s2">&quot;TOutputCode&quot;</span><span class="p">,</span> <span class="n">bound</span><span class="o">=</span><span class="n">OutputCode</span><span class="p">)</span>


<span class="k">class</span> <span class="nc">AOTDispatchCompiler</span><span class="p">(</span><span class="n">Protocol</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Represents a fw or bw_compiler passed to AOTAutograd.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">gm</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">fx</span><span class="o">.</span><span class="n">GraphModule</span><span class="p">,</span>
<span class="n">example_inputs</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">InputType</span><span class="p">],</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Any</span><span class="p">:</span>
<span class="o">...</span>


<span class="c1"># TODO: bikeshed on this name</span>
<span class="k">class</span> <span class="nc">SerializableAOTDispatchCompiler</span><span class="p">(</span><span class="n">AOTDispatchCompiler</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Represents an AOTDispatchCompiler that returns an OutputCode, and is</span>
<span class="sd"> therefore cacheable. SerializableAOTDispatchCompiler always return an OutputCode.</span>
<span class="sd"> A _CompileFxCallable usually gets converted into an AOTDispatchCompiler after binding all of</span>
<span class="sd"> the kwargs in _CompileFxKwargs.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">output_code_ty</span><span class="p">:</span> <span class="n">Type</span><span class="p">[</span><span class="n">TOutputCode</span><span class="p">],</span>
<span class="n">compiler_fn</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[</span><span class="n">torch</span><span class="o">.</span><span class="n">fx</span><span class="o">.</span><span class="n">GraphModule</span><span class="p">,</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">InputType</span><span class="p">]],</span> <span class="n">TOutputCode</span><span class="p">],</span>
<span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">output_code_ty</span> <span class="o">=</span> <span class="n">output_code_ty</span>
<span class="bp">self</span><span class="o">.</span><span class="n">compiler_fn</span> <span class="o">=</span> <span class="n">compiler_fn</span>

<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">gm</span><span class="p">:</span> <span class="n">torch</span><span class="o">.</span><span class="n">fx</span><span class="o">.</span><span class="n">GraphModule</span><span class="p">,</span>
<span class="n">example_inputs</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">InputType</span><span class="p">],</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">OutputCode</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">compiler_fn</span><span class="p">(</span><span class="n">gm</span><span class="p">,</span> <span class="n">example_inputs</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">process_inputs</span><span class="p">(</span>
<span class="n">flat_args</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Any</span><span class="p">],</span>
<span class="n">aot_config</span><span class="p">:</span> <span class="n">AOTConfig</span><span class="p">,</span>
Expand Down Expand Up @@ -1339,12 +1393,12 @@ <h1>Source code for torch._functorch.aot_autograd</h1><div class="highlight"><pr
<span class="k">def</span> <span class="nf">aot_module_simplified</span><span class="p">(</span>
<span class="n">mod</span><span class="p">:</span> <span class="n">nn</span><span class="o">.</span><span class="n">Module</span><span class="p">,</span>
<span class="n">args</span><span class="p">,</span>
<span class="n">fw_compiler</span><span class="p">:</span> <span class="n">Callable</span><span class="p">,</span>
<span class="n">bw_compiler</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">fw_compiler</span><span class="p">:</span> <span class="n">AOTDispatchCompiler</span><span class="p">,</span>
<span class="n">bw_compiler</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">AOTDispatchCompiler</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">partition_fn</span><span class="p">:</span> <span class="n">Callable</span> <span class="o">=</span> <span class="n">default_partition</span><span class="p">,</span>
<span class="n">decompositions</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Dict</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">keep_inference_input_mutations</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">inference_compiler</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">inference_compiler</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">AOTDispatchCompiler</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">cudagraphs</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">BoxedBool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">nn</span><span class="o">.</span><span class="n">Module</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
Expand Down Expand Up @@ -1472,8 +1526,8 @@ <h1>Source code for torch._functorch.aot_autograd</h1><div class="highlight"><pr
<span class="c1"># Autograd cache stuff</span>
<span class="n">remote</span> <span class="o">=</span> <span class="n">should_use_remote_autograd_cache</span><span class="p">()</span>
<span class="n">local</span> <span class="o">=</span> <span class="n">should_use_local_autograd_cache</span><span class="p">()</span>

<span class="k">if</span> <span class="n">local</span> <span class="ow">or</span> <span class="n">remote</span><span class="p">:</span>
<span class="c1"># We only care if the forward will return an OutputCode.</span>
<span class="k">if</span> <span class="p">(</span><span class="n">local</span> <span class="ow">or</span> <span class="n">remote</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">fw_compiler</span><span class="p">,</span> <span class="n">SerializableAOTDispatchCompiler</span><span class="p">):</span>
<span class="n">compiled_fn</span> <span class="o">=</span> <span class="n">AOTAutogradCache</span><span class="o">.</span><span class="n">load</span><span class="p">(</span>
<span class="n">dispatch_and_compile</span><span class="p">,</span>
<span class="n">mod</span><span class="p">,</span>
Expand Down
2 changes: 1 addition & 1 deletion nightly/_modules/torch/_functorch/compilers.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/_modules/torch/_functorch/deprecated.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/_modules/torch/_functorch/partitioners.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/aot_autograd.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/batch_norm.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/experimental.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/functorch.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.compile.aot_function.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.compile.aot_module.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.compile.default_partition.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.compile.nop.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.compile.ts_compile.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.functionalize.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.grad.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.grad_and_value.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.hessian.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.jacfwd.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.jacrev.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
2 changes: 1 addition & 1 deletion nightly/generated/functorch.jvp.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<div class="pytorch-left-menu-search">

<div class="version">
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+gitefab8c4) &#x25BC</a>
<a href='https://pytorch.org/functorch/versions.html'>nightly (2.6.0a0+git0052943) &#x25BC</a>
</div>


Expand Down
Loading

0 comments on commit 236fc3e

Please sign in to comment.