Skip to content

Commit

Permalink
Deploying to gh-pages from @ e9edb28 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
facebook-github-bot committed Aug 15, 2024
1 parent 1df782b commit 5a184ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions master/_modules/torchtnt/utils/prepare_module.html
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ <h1>Source code for torchtnt.utils.prepare_module</h1><div class="highlight"><pr
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">if</span> <span class="n">strategy</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">strategy</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">strategy</span><span class="p">,</span> <span class="n">Strategy</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Unknown strategy received: </span><span class="si">{</span><span class="n">strategy</span><span class="si">}</span><span class="s2">. Expect either str or Strategy dataclass&quot;</span>
<span class="p">)</span>

<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">strategy</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">strategy</span> <span class="o">=</span> <span class="n">convert_str_to_strategy</span><span class="p">(</span><span class="n">strategy</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">strategy</span><span class="p">,</span> <span class="n">DDPStrategy</span><span class="p">):</span>
Expand Down

0 comments on commit 5a184ee

Please sign in to comment.