About ''.narrow''

ky_Pa: <p>Hi,<br>
I encounter the problem when I try to modify the code.I did not find the indentation problem after checking, so does the problem occur in the use of narrow?I’m thinking of changing the second division to third division through narrow.<br>
Looking forward to your answers. Thanks!</p>
<pre><code class="lang-auto">        s1_output_cla = output_cla.narrow(0, 0, int(inputs.size(0)/3))
        s2_output_cla = output_cla.narrow(0, int(inputs.size(0)/3, int(inputs.size(0)/3))
        s1_output_rec = output_rec_s1.narrow(0, 0, int(inputs.size(0)/3))
        s2_output_rec = output_rec_s2.narrow(0, int(inputs.size(0)/3, int(inputs.size(0)/3))
        t_output_rec = output_rec_t.narrow(0, int(inputs.size(0)*2/3), int(inputs.size(0)/3))
        s1_z = output_z.narrow(0, 0, int(output_z.size(0)/3))
        s2_z = output_z.narrow(0, int(output_z.size(0)/3, int(output_z.size(0)/3))
        t_z = output_z.narrow(0, int(output_z.size(0)*2/3), int(output_z.size(0)/3))
</code></pre>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/7/67243cd06127a2824c06cb9217aa27a212da4524.png" data-download-href="https://discuss.pytorch.org/uploads/default/67243cd06127a2824c06cb9217aa27a212da4524" title="微信图片_20210113173002"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/7/67243cd06127a2824c06cb9217aa27a212da4524_2_690x155.png" alt="微信图片_20210113173002" data-base62-sha1="eIqOICm2baHWWg0sYACo1JpWoqo" width="690" height="155" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/7/67243cd06127a2824c06cb9217aa27a212da4524_2_690x155.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/7/67243cd06127a2824c06cb9217aa27a212da4524_2_1035x232.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/7/67243cd06127a2824c06cb9217aa27a212da4524_2_1380x310.png 2x" data-dominant-color="3A3D39"><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">微信图片_20210113173002</span><span class="informations">1422×321 86.9 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>

albanD: <p>Hi,</p>
<p>Could you share the full stack trace of the error please?</p>

ky_Pa: <aside class="quote no-group" data-username="albanD" data-post="2" data-topic="108697">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/48/215_2.png" class="avatar"> albanD:</div>
<blockquote>
<p>Could you share the full stack trace of the error please?</p>
</blockquote>
</aside>
<pre><code class="lang-auto">  File "F:\MDA\main-office.py", line 451
    s1_output_rec = output_rec_s1.narrow(0, 0, int(inputs.size(0)/3))
                ^
SyntaxError: invalid syntax
[Finished in 0.1s with exit code 1]</code></pre>

albanD: <p>I think you’re missing a closing parenthesis on the line above this one. It should be:</p>
<pre><code class="lang-auto">        s2_output_cla = output_cla.narrow(0, int(inputs.size(0)/3), int(inputs.size(0)/3))
</code></pre>

ky_Pa: <p>Thank you very much! I am dazzled.</p>