Skip to content

Commit

Permalink
[doc_push][main] built from 710f654 (main). Redirects: main -> 0.8.0d…
Browse files Browse the repository at this point in the history
…ev0.
  • Loading branch information
TorchX CI Runner committed Sep 17, 2024
1 parent f6a2308 commit b6459e8
Show file tree
Hide file tree
Showing 13 changed files with 755 additions and 1,495 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions 0.8.0dev0/_modules/torchx/specs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,9 @@ <h1>Source code for torchx.specs.api</h1><div class="highlight"><pre>

<span class="c1"># pyre-strict</span>

<span class="kn">import</span> <span class="nn">asyncio</span>
<span class="kn">import</span> <span class="nn">copy</span>
<span class="kn">import</span> <span class="nn">inspect</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">typing</span>
Expand Down Expand Up @@ -811,6 +813,24 @@ <h1>Source code for torchx.specs.api</h1><div class="highlight"><pre>
<span class="n">mounts</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">BindMount</span><span class="p">,</span> <span class="n">VolumeMount</span><span class="p">,</span> <span class="n">DeviceMount</span><span class="p">]]</span> <span class="o">=</span> <span class="n">field</span><span class="p">(</span>
<span class="n">default_factory</span><span class="o">=</span><span class="nb">list</span>
<span class="p">)</span>
<span class="n">overrides</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="n">field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">dict</span><span class="p">)</span>

<span class="c1"># pyre-ignore</span>
<span class="k">def</span> <span class="fm">__getattribute__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Any</span><span class="p">:</span>
<span class="k">if</span> <span class="n">attrname</span> <span class="o">==</span> <span class="s2">&quot;overrides&quot;</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__getattribute__</span><span class="p">(</span><span class="n">attrname</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">ov</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__getattribute__</span><span class="p">(</span><span class="s2">&quot;overrides&quot;</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="n">ov</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">if</span> <span class="n">attrname</span> <span class="ow">in</span> <span class="n">ov</span><span class="p">:</span>
<span class="k">if</span> <span class="n">inspect</span><span class="o">.</span><span class="n">isawaitable</span><span class="p">(</span><span class="n">ov</span><span class="p">[</span><span class="n">attrname</span><span class="p">]):</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">get_event_loop</span><span class="p">()</span><span class="o">.</span><span class="n">run_until_complete</span><span class="p">(</span><span class="n">ov</span><span class="p">[</span><span class="n">attrname</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">ov</span><span class="p">[</span><span class="n">attrname</span><span class="p">]()</span>
<span class="nb">setattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">,</span> <span class="n">result</span><span class="p">)</span>
<span class="k">del</span> <span class="n">ov</span><span class="p">[</span><span class="n">attrname</span><span class="p">]</span>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__getattribute__</span><span class="p">(</span><span class="n">attrname</span><span class="p">)</span>

<div class="viewcode-block" id="Role.pre_proc"><a class="viewcode-back" href="../../../specs.html#torchx.specs.Role.pre_proc">[docs]</a> <span class="k">def</span> <span class="nf">pre_proc</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
Expand Down
Loading

0 comments on commit b6459e8

Please sign in to comment.