Skip to content

Commit

Permalink
Update doc from commit 8ac6425
Browse files Browse the repository at this point in the history
  • Loading branch information
torchxlabot2 committed Jul 10, 2024
1 parent 78130a2 commit 20905c0
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion release/r2.4/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/_modules/torch_xla/core/xla_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/_modules/torch_xla/debug/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
19 changes: 16 additions & 3 deletions release/r2.4/_modules/torch_xla/experimental/eager.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down Expand Up @@ -369,6 +369,7 @@

<h1>Source code for torch_xla.experimental.eager</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">functools</span>
<span class="kn">from</span> <span class="nn">contextlib</span> <span class="kn">import</span> <span class="n">contextmanager</span>

<span class="kn">import</span> <span class="nn">torch_xla</span>

Expand All @@ -388,6 +389,18 @@ <h1>Source code for torch_xla.experimental.eager</h1><div class="highlight"><pre
<span class="k">return</span> <span class="n">torch_xla</span><span class="o">.</span><span class="n">_XLAC</span><span class="o">.</span><span class="n">_get_use_eager_mode</span><span class="p">()</span>


<span class="nd">@contextmanager</span>
<span class="k">def</span> <span class="nf">eager_mode_context</span><span class="p">(</span><span class="n">enable</span><span class="p">:</span> <span class="nb">bool</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Context manager to enable/disable the eager mode.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">saved_eager_mode</span> <span class="o">=</span> <span class="n">is_eager_mode</span><span class="p">()</span>
<span class="n">eager_mode</span><span class="p">(</span><span class="n">enable</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">yield</span> <span class="n">saved_eager_mode</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">eager_mode</span><span class="p">(</span><span class="n">saved_eager_mode</span><span class="p">)</span>


<div class="viewcode-block" id="compile"><a class="viewcode-back" href="../../../index.html#torch_xla.experimental.compile">[docs]</a><span class="k">def</span> <span class="nf">compile</span><span class="p">(</span><span class="n">func</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Compile the func with Lazy Tensor.</span>

Expand All @@ -405,12 +418,12 @@ <h1>Source code for torch_xla.experimental.eager</h1><div class="highlight"><pre
<span class="k">try</span><span class="p">:</span>
<span class="c1"># Target Function Execution</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">func</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="c1"># Sync the graph generated by the target function.</span>
<span class="n">torch_xla</span><span class="o">.</span><span class="n">sync</span><span class="p">()</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="c1"># Handle exceptions (if needed)</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Error in target function: </span><span class="si">{</span><span class="n">e</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">raise</span> <span class="c1"># Re-raise the exception</span>
<span class="c1"># Sync the graph generated by the target function.</span>
<span class="n">torch_xla</span><span class="o">.</span><span class="n">sync</span><span class="p">()</span>
<span class="n">torch_xla</span><span class="o">.</span><span class="n">_XLAC</span><span class="o">.</span><span class="n">_set_use_eager_mode</span><span class="p">(</span><span class="kc">True</span><span class="p">)</span>

<span class="k">return</span> <span class="n">result</span>
Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/_modules/torch_xla/runtime.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/_modules/torch_xla/torch_xla.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/notes/source_of_recompilation.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
Binary file modified release/r2.4/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion release/r2.4/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down
2 changes: 1 addition & 1 deletion release/r2.4/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@


<div class="version">
master (2.4.0+git18b351f )
master (2.4.0+git8ac6425 )
</div>


Expand Down

0 comments on commit 20905c0

Please sign in to comment.