Problem in pad_packed_sequence

Amazing: <p>When I use package_padded_sequence and pad_packed_sequence to handle variable length sequences.I have a problem, that is, I can’t print the result of pad_packed_sequence output when my batch_first is set to True.<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/a/a0266b725dcdcd5ddbab8e75e3c0e3a8fba40681.png" data-download-href="https://discuss.pytorch.org/uploads/default/a0266b725dcdcd5ddbab8e75e3c0e3a8fba40681" title="2019-08-09%2016-13-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/a/a0266b725dcdcd5ddbab8e75e3c0e3a8fba40681_2_690x350.png" alt="2019-08-09%2016-13-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE" data-base62-sha1="mQKHXTkhZZEbZjvMNPTJzzAWU1j" width="690" height="350" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/a/a0266b725dcdcd5ddbab8e75e3c0e3a8fba40681_2_690x350.png, https://discuss.pytorch.org/uploads/default/optimized/2X/a/a0266b725dcdcd5ddbab8e75e3c0e3a8fba40681_2_1035x525.png 1.5x, https://discuss.pytorch.org/uploads/default/original/2X/a/a0266b725dcdcd5ddbab8e75e3c0e3a8fba40681.png 2x" data-dominant-color="3B3B3B"><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">2019-08-09%2016-13-54%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE</span><span class="informations">1042×529 79.7 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>
However, once I set the batch_first in the pad_packed_sequence function to False, I can output the result correctly.<br>
Thank you for your help.</p>

Amazing: <p>Because it is a newcomer, I can only upload one image. Below is a part of the code I wrote.<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/e/e6c07e09bee4143455780e1bd8e62f4688075995.png" data-download-href="https://discuss.pytorch.org/uploads/default/e6c07e09bee4143455780e1bd8e62f4688075995" title="2019-08-09%2016-17-36%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/e/e6c07e09bee4143455780e1bd8e62f4688075995_2_451x500.png" alt="2019-08-09%2016-17-36%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE" data-base62-sha1="wVkekt7QXFcIrZNBdY7YUn3IspD" width="451" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/e/e6c07e09bee4143455780e1bd8e62f4688075995_2_451x500.png, https://discuss.pytorch.org/uploads/default/optimized/2X/e/e6c07e09bee4143455780e1bd8e62f4688075995_2_676x750.png 1.5x, https://discuss.pytorch.org/uploads/default/original/2X/e/e6c07e09bee4143455780e1bd8e62f4688075995.png 2x" data-dominant-color="F1EFF2"><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">2019-08-09%2016-17-36%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE</span><span class="informations">864×957 113 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>

ptrblck: <p>The error message points to a non-contiguous tensor.<br>
Call <code>.contiguous()</code> on your tensor before the <code>.view()</code> call.</p>
<p>Based on the error message, this should work:</p>
<pre><code class="lang-python">start = [get_summarized_data(self[i]).contiguous().view(-1) for i in range(...)]
</code></pre>

Amazing: <p>Thank you for your help！！</p>