Train doesn't work, no response at all!

StevenJokes: <p>I’m learning “Dive into deep learning” book by translating mxnet code to pytorch.</p>
<hr>
<p>I have translated <a href="http://preview.d2l.ai/d2l-en/master/chapter_generative-adversarial-networks/gan.html" rel="noopener nofollow ugc">GAN</a> successfully.</p>
<p><a href="https://github.com/d2l-ai/d2l-en/commits/master:" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/d2l-ai/d2l-en/commits/master:</a><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/6/5693058647a6ae4d19ec1a64a1a1f84add3c86fa.png" data-download-href="https://discuss.pytorch.org/uploads/default/5693058647a6ae4d19ec1a64a1a1f84add3c86fa" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/6/5693058647a6ae4d19ec1a64a1a1f84add3c86fa_2_690x184.png" alt="image" data-base62-sha1="clS3oqqhjFQBXoRY419tN3slTQe" width="690" height="184" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/6/5693058647a6ae4d19ec1a64a1a1f84add3c86fa_2_690x184.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/6/5693058647a6ae4d19ec1a64a1a1f84add3c86fa_2_1035x276.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/5/6/5693058647a6ae4d19ec1a64a1a1f84add3c86fa_2_1380x368.png 2x" data-dominant-color="F9F8F9"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1889×506 67 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<hr>
<p>But I’m stuck almost two weeks about <a href="http://preview.d2l.ai/d2l-en/PR-1400/chapter_generative-adversarial-networks/dcgan.html" rel="noopener nofollow ugc">DCGAN</a></p>
<p>There isn’t any bugs poping up, but no response to my train.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/d/6d5cc65633d6fe12de2d38d856fd8ecbf7d0bb29.png" data-download-href="https://discuss.pytorch.org/uploads/default/6d5cc65633d6fe12de2d38d856fd8ecbf7d0bb29" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/d/6d5cc65633d6fe12de2d38d856fd8ecbf7d0bb29_2_690x254.png" alt="image" data-base62-sha1="fBsOqd3P2phzrb3grLcl3O8GnaN" width="690" height="254" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/d/6d5cc65633d6fe12de2d38d856fd8ecbf7d0bb29_2_690x254.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/d/6d5cc65633d6fe12de2d38d856fd8ecbf7d0bb29_2_1035x381.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/d/6d5cc65633d6fe12de2d38d856fd8ecbf7d0bb29_2_1380x508.png 2x" data-dominant-color="F8F7F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1951×719 73.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
My code: <a href="https://github.com/StevenJokes/d2l-en-read/blob/master/chapter-generative-adversarial-networks/colab_pt_DCGAN/DCGAN-trainX.ipynb" rel="noopener nofollow ugc">https://github.com/StevenJokes/d2l-en-read/blob/master/chapter-generative-adversarial-networks/colab_pt_DCGAN/DCGAN-trainX.ipynb</a><br>
OR:<br>
<a href="https://nbviewer.jupyter.org/github/StevenJokes/d2l-en-read/blob/master/chapter-generative-adversarial-networks/colab_pt_DCGAN/DCGAN-trainX.ipynb" rel="noopener nofollow ugc">https://nbviewer.jupyter.org/github/StevenJokes/d2l-en-read/blob/master/chapter-generative-adversarial-networks/colab_pt_DCGAN/DCGAN-trainX.ipynb</a></p>
<p>Can anyone help me? Thanks in advance.<br>
You maybe need to contrast <a href="http://preview.d2l.ai/d2l-en/PR-1400/chapter_generative-adversarial-networks/dcgan.html" rel="noopener nofollow ugc">mxnet</a> code with my pytorch code.</p>

StevenJokes: <aside class="onebox githubpullrequest">
  <header class="source">
      <a href="https://github.com/d2l-ai/d2l-en/pull/1309" target="_blank" rel="nofollow noopener">github.com/d2l-ai/d2l-en</a>
  </header>
  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Pull Request">
    <svg width="60" height="60" class="github-icon" viewBox="0 0 12 16" aria-hidden="true"><path d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/d2l-ai/d2l-en/pull/1309" target="_blank" rel="nofollow noopener">[Completed][pytorch] add DCGAN</a>
    </h4>

    <div class="branches">
      <code>d2l-ai:master</code> ← <code>StevenJokes:DCGAN</code>
    </div>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2020-08-08" data-time="07:25:57" data-timezone="UTC">07:25AM - 08 Aug 20 UTC</span>
      </div>

      <div class="user">
        <a href="https://github.com/StevenJokes" target="_blank" rel="nofollow noopener">
          <img alt="StevenJokes" src="https://avatars3.githubusercontent.com/u/25657787?v=4" class="onebox-avatar-inline" width="20" height="20">
          StevenJokes
        </a>
      </div>

      <div class="lines" title="12 commits changed 1 files with 243 additions and 18 deletions">
        <a href="https://github.com/d2l-ai/d2l-en/pull/1309/files" target="_blank" rel="nofollow noopener">
          <span class="added">+243</span>
          <span class="removed">-18</span>
        </a>
      </div>
    </div>

  </div>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
Fix now.